From 0adb0c84ee7c43c218acabf895bf4199eea75aba Mon Sep 17 00:00:00 2001 From: Jaycee Li Date: Thu, 30 Jul 2026 19:17:05 -0700 Subject: [PATCH] chore: Refactor the internal serialization methods PiperOrigin-RevId: 956866001 --- src/main/java/com/google/genai/AfcUtil.java | 6 +- .../java/com/google/genai/AsyncBatches.java | 4 +- .../java/com/google/genai/AsyncCaches.java | 4 +- .../java/com/google/genai/AsyncDocuments.java | 4 +- .../google/genai/AsyncFileSearchStores.java | 4 +- .../java/com/google/genai/AsyncFiles.java | 5 +- src/main/java/com/google/genai/AsyncLive.java | 8 +- .../java/com/google/genai/AsyncModels.java | 30 +- .../java/com/google/genai/AsyncPager.java | 4 +- .../java/com/google/genai/AsyncSession.java | 6 +- .../java/com/google/genai/AsyncTunings.java | 14 +- src/main/java/com/google/genai/BasePager.java | 4 +- src/main/java/com/google/genai/Batches.java | 247 +++--- src/main/java/com/google/genai/Caches.java | 192 +++-- src/main/java/com/google/genai/Common.java | 235 +++++- src/main/java/com/google/genai/Documents.java | 42 +- .../com/google/genai/FileSearchStores.java | 97 ++- src/main/java/com/google/genai/Files.java | 69 +- .../com/google/genai/JsonSerializable.java | 137 +--- .../java/com/google/genai/LiveConverters.java | 216 +++--- src/main/java/com/google/genai/Models.java | 714 ++++++++---------- .../java/com/google/genai/Operations.java | 49 +- .../google/genai/OperationsConverters.java | 53 +- src/main/java/com/google/genai/Pager.java | 5 +- .../com/google/genai/ReplayApiClient.java | 22 +- .../com/google/genai/ReplayApiResponse.java | 5 +- .../java/com/google/genai/ResponseStream.java | 10 +- src/main/java/com/google/genai/Tokens.java | 9 +- .../com/google/genai/TokensConverters.java | 68 +- .../java/com/google/genai/Transformers.java | 68 +- src/main/java/com/google/genai/Tunings.java | 183 +++-- .../com/google/genai/types/ActivityEnd.java | 3 +- .../com/google/genai/types/ActivityStart.java | 3 +- .../google/genai/types/AggregationOutput.java | 3 +- .../google/genai/types/AggregationResult.java | 3 +- .../java/com/google/genai/types/ApiAuth.java | 3 +- .../genai/types/ApiAuthApiKeyConfig.java | 3 +- .../com/google/genai/types/ApiKeyConfig.java | 3 +- .../genai/types/AudioResponseFormat.java | 3 +- .../genai/types/AudioTranscriptionConfig.java | 3 +- .../com/google/genai/types/AuthConfig.java | 3 +- .../AuthConfigGoogleServiceAccountConfig.java | 3 +- .../types/AuthConfigHttpBasicAuthConfig.java | 3 +- .../genai/types/AuthConfigOauthConfig.java | 3 +- .../genai/types/AuthConfigOidcConfig.java | 3 +- .../com/google/genai/types/AuthToken.java | 3 +- .../types/AutomaticActivityDetection.java | 3 +- .../types/AutomaticFunctionCallingConfig.java | 3 +- .../google/genai/types/AutoraterConfig.java | 3 +- .../com/google/genai/types/AvatarConfig.java | 3 +- .../java/com/google/genai/types/BatchJob.java | 3 +- .../genai/types/BatchJobDestination.java | 3 +- .../genai/types/BatchJobOutputInfo.java | 3 +- .../google/genai/types/BatchJobSource.java | 3 +- .../google/genai/types/BigQuerySource.java | 3 +- .../google/genai/types/BleuMetricValue.java | 3 +- .../java/com/google/genai/types/BleuSpec.java | 3 +- .../java/com/google/genai/types/Blob.java | 3 +- .../com/google/genai/types/CachedContent.java | 3 +- .../types/CachedContentUsageMetadata.java | 3 +- .../genai/types/CancelBatchJobConfig.java | 3 +- .../genai/types/CancelBatchJobParameters.java | 3 +- .../genai/types/CancelTuningJobConfig.java | 3 +- .../types/CancelTuningJobParameters.java | 3 +- .../genai/types/CancelTuningJobResponse.java | 3 +- .../com/google/genai/types/Candidate.java | 3 +- .../com/google/genai/types/Checkpoint.java | 3 +- .../google/genai/types/ChunkingConfig.java | 3 +- .../java/com/google/genai/types/Citation.java | 3 +- .../google/genai/types/CitationMetadata.java | 3 +- .../com/google/genai/types/ClientOptions.java | 3 +- .../genai/types/CodeExecutionResult.java | 3 +- .../google/genai/types/CompletionStats.java | 3 +- ...positeReinforcementTuningRewardConfig.java | 4 +- ...uningRewardConfigWeightedRewardConfig.java | 3 +- .../types/ComputationBasedMetricSpec.java | 3 +- .../genai/types/ComputeTokensConfig.java | 3 +- .../genai/types/ComputeTokensParameters.java | 3 +- .../genai/types/ComputeTokensResponse.java | 3 +- .../genai/types/ComputeTokensResult.java | 3 +- .../com/google/genai/types/ComputerUse.java | 3 +- .../java/com/google/genai/types/Content.java | 3 +- .../google/genai/types/ContentEmbedding.java | 3 +- .../types/ContentEmbeddingStatistics.java | 3 +- .../genai/types/ContentReferenceImage.java | 3 +- .../types/ContextWindowCompressionConfig.java | 3 +- .../genai/types/ControlReferenceConfig.java | 3 +- .../genai/types/ControlReferenceImage.java | 3 +- .../google/genai/types/CountTokensConfig.java | 3 +- .../genai/types/CountTokensParameters.java | 3 +- .../genai/types/CountTokensResponse.java | 3 +- .../google/genai/types/CountTokensResult.java | 3 +- .../genai/types/CreateAuthTokenConfig.java | 3 +- .../types/CreateAuthTokenParameters.java | 3 +- .../genai/types/CreateBatchJobConfig.java | 3 +- .../genai/types/CreateBatchJobParameters.java | 3 +- .../types/CreateCachedContentConfig.java | 3 +- .../types/CreateCachedContentParameters.java | 3 +- .../types/CreateEmbeddingsBatchJobConfig.java | 3 +- .../CreateEmbeddingsBatchJobParameters.java | 3 +- .../google/genai/types/CreateFileConfig.java | 3 +- .../genai/types/CreateFileParameters.java | 3 +- .../genai/types/CreateFileResponse.java | 3 +- .../types/CreateFileSearchStoreConfig.java | 3 +- .../CreateFileSearchStoreParameters.java | 3 +- .../genai/types/CreateTuningJobConfig.java | 3 +- .../types/CreateTuningJobParameters.java | 3 +- .../CreateTuningJobParametersPrivate.java | 3 +- .../types/CustomCodeExecutionResult.java | 3 +- .../genai/types/CustomCodeExecutionSpec.java | 3 +- .../google/genai/types/CustomMetadata.java | 3 +- .../com/google/genai/types/CustomOutput.java | 3 +- .../genai/types/CustomOutputFormatConfig.java | 3 +- .../google/genai/types/CustomizedAvatar.java | 3 +- .../genai/types/DatasetDistribution.java | 3 +- ...DatasetDistributionDistributionBucket.java | 3 +- .../com/google/genai/types/DatasetStats.java | 3 +- .../genai/types/DeleteBatchJobConfig.java | 3 +- .../genai/types/DeleteBatchJobParameters.java | 3 +- .../types/DeleteCachedContentConfig.java | 3 +- .../types/DeleteCachedContentParameters.java | 3 +- .../types/DeleteCachedContentResponse.java | 3 +- .../genai/types/DeleteDocumentConfig.java | 3 +- .../genai/types/DeleteDocumentParameters.java | 3 +- .../google/genai/types/DeleteFileConfig.java | 3 +- .../genai/types/DeleteFileParameters.java | 3 +- .../genai/types/DeleteFileResponse.java | 3 +- .../types/DeleteFileSearchStoreConfig.java | 3 +- .../DeleteFileSearchStoreParameters.java | 3 +- .../google/genai/types/DeleteModelConfig.java | 3 +- .../genai/types/DeleteModelParameters.java | 3 +- .../genai/types/DeleteModelResponse.java | 3 +- .../google/genai/types/DeleteResourceJob.java | 3 +- .../genai/types/DistillationDataStats.java | 3 +- .../types/DistillationHyperParameters.java | 3 +- .../genai/types/DistillationSamplingSpec.java | 3 +- .../google/genai/types/DistillationSpec.java | 3 +- .../java/com/google/genai/types/Document.java | 3 +- .../genai/types/DownloadFileConfig.java | 3 +- .../genai/types/DownloadMediaConfig.java | 3 +- .../genai/types/DynamicRetrievalConfig.java | 3 +- .../google/genai/types/EditImageConfig.java | 3 +- .../genai/types/EditImageParameters.java | 3 +- .../google/genai/types/EditImageResponse.java | 3 +- .../google/genai/types/EmbedContentBatch.java | 3 +- .../genai/types/EmbedContentConfig.java | 3 +- .../genai/types/EmbedContentMetadata.java | 3 +- .../genai/types/EmbedContentParameters.java | 3 +- .../types/EmbedContentParametersPrivate.java | 3 +- .../genai/types/EmbedContentResponse.java | 3 +- .../genai/types/EmbeddingsBatchJobSource.java | 3 +- .../google/genai/types/EncryptionSpec.java | 3 +- .../java/com/google/genai/types/Endpoint.java | 3 +- .../genai/types/EnterpriseWebSearch.java | 3 +- .../com/google/genai/types/EntityLabel.java | 3 +- .../genai/types/EvaluateDatasetResponse.java | 3 +- .../genai/types/EvaluateDatasetRun.java | 3 +- .../google/genai/types/EvaluationConfig.java | 3 +- .../google/genai/types/EvaluationDataset.java | 3 +- .../genai/types/EvaluationParserConfig.java | 3 +- ...ionParserConfigCustomCodeParserConfig.java | 4 +- .../genai/types/ExactMatchMetricValue.java | 3 +- .../google/genai/types/ExecutableCode.java | 3 +- .../com/google/genai/types/ExternalApi.java | 3 +- .../types/ExternalApiElasticSearchParams.java | 3 +- .../types/ExternalApiSimpleSearchParams.java | 3 +- .../types/FetchPredictOperationConfig.java | 3 +- .../FetchPredictOperationParameters.java | 3 +- .../java/com/google/genai/types/File.java | 3 +- .../java/com/google/genai/types/FileData.java | 3 +- .../com/google/genai/types/FileSearch.java | 3 +- .../google/genai/types/FileSearchStore.java | 3 +- .../com/google/genai/types/FileStatus.java | 3 +- .../genai/types/FullFineTuningSpec.java | 3 +- .../com/google/genai/types/FunctionCall.java | 3 +- .../genai/types/FunctionCallingConfig.java | 3 +- .../genai/types/FunctionDeclaration.java | 3 +- .../google/genai/types/FunctionResponse.java | 3 +- .../genai/types/FunctionResponseBlob.java | 3 +- .../genai/types/FunctionResponseFileData.java | 3 +- .../genai/types/FunctionResponsePart.java | 3 +- .../google/genai/types/GcsDestination.java | 3 +- .../com/google/genai/types/GcsSource.java | 3 +- .../genai/types/GeminiPreferenceExample.java | 3 +- .../GeminiPreferenceExampleCompletion.java | 3 +- .../genai/types/GenerateContentConfig.java | 3 +- .../types/GenerateContentParameters.java | 3 +- .../genai/types/GenerateContentResponse.java | 3 +- ...GenerateContentResponsePromptFeedback.java | 3 +- .../GenerateContentResponseUsageMetadata.java | 3 +- .../genai/types/GenerateImagesConfig.java | 3 +- .../genai/types/GenerateImagesParameters.java | 3 +- .../genai/types/GenerateImagesResponse.java | 3 +- .../genai/types/GenerateVideosConfig.java | 3 +- .../genai/types/GenerateVideosOperation.java | 6 +- .../genai/types/GenerateVideosParameters.java | 3 +- .../genai/types/GenerateVideosResponse.java | 3 +- .../genai/types/GenerateVideosSource.java | 3 +- .../google/genai/types/GeneratedImage.java | 3 +- .../genai/types/GeneratedImageMask.java | 3 +- .../google/genai/types/GeneratedVideo.java | 3 +- .../google/genai/types/GenerationConfig.java | 3 +- .../types/GenerationConfigRoutingConfig.java | 3 +- ...ionConfigRoutingConfigAutoRoutingMode.java | 4 +- ...nConfigRoutingConfigManualRoutingMode.java | 4 +- .../google/genai/types/GetBatchJobConfig.java | 3 +- .../genai/types/GetBatchJobParameters.java | 3 +- .../genai/types/GetCachedContentConfig.java | 3 +- .../types/GetCachedContentParameters.java | 3 +- .../google/genai/types/GetDocumentConfig.java | 3 +- .../genai/types/GetDocumentParameters.java | 3 +- .../com/google/genai/types/GetFileConfig.java | 3 +- .../google/genai/types/GetFileParameters.java | 3 +- .../genai/types/GetFileSearchStoreConfig.java | 3 +- .../types/GetFileSearchStoreParameters.java | 3 +- .../google/genai/types/GetModelConfig.java | 3 +- .../genai/types/GetModelParameters.java | 3 +- .../genai/types/GetOperationConfig.java | 3 +- .../genai/types/GetOperationParameters.java | 3 +- .../genai/types/GetTuningJobConfig.java | 3 +- .../genai/types/GetTuningJobParameters.java | 3 +- .../com/google/genai/types/GoogleMaps.java | 3 +- .../genai/types/GoogleMapsGroundingTypes.java | 3 +- .../google/genai/types/GoogleMapsPlaces.java | 3 +- .../google/genai/types/GoogleMapsRouting.java | 3 +- .../google/genai/types/GoogleRpcStatus.java | 3 +- .../com/google/genai/types/GoogleSearch.java | 3 +- .../genai/types/GoogleSearchRetrieval.java | 3 +- .../google/genai/types/GoogleTypeDate.java | 3 +- .../google/genai/types/GroundingChunk.java | 3 +- .../types/GroundingChunkCustomMetadata.java | 3 +- .../genai/types/GroundingChunkImage.java | 3 +- .../genai/types/GroundingChunkMaps.java | 3 +- .../GroundingChunkMapsPlaceAnswerSources.java | 3 +- ...psPlaceAnswerSourcesAuthorAttribution.java | 3 +- ...nkMapsPlaceAnswerSourcesReviewSnippet.java | 3 +- .../genai/types/GroundingChunkMapsRoute.java | 3 +- .../types/GroundingChunkRetrievedContext.java | 3 +- .../genai/types/GroundingChunkStringList.java | 3 +- .../google/genai/types/GroundingChunkWeb.java | 3 +- .../google/genai/types/GroundingMetadata.java | 3 +- .../GroundingMetadataSourceFlaggingUri.java | 3 +- .../google/genai/types/GroundingSupport.java | 3 +- .../com/google/genai/types/HistoryConfig.java | 3 +- .../com/google/genai/types/HttpOptions.java | 3 +- .../com/google/genai/types/HttpResponse.java | 3 +- .../google/genai/types/HttpRetryOptions.java | 3 +- .../java/com/google/genai/types/Image.java | 3 +- .../com/google/genai/types/ImageConfig.java | 3 +- .../types/ImageConfigImageOutputOptions.java | 3 +- .../genai/types/ImageResponseFormat.java | 3 +- .../com/google/genai/types/ImageSearch.java | 3 +- .../google/genai/types/ImportFileConfig.java | 3 +- .../genai/types/ImportFileOperation.java | 6 +- .../genai/types/ImportFileParameters.java | 3 +- .../genai/types/ImportFileResponse.java | 3 +- .../types/InlinedEmbedContentResponse.java | 3 +- .../google/genai/types/InlinedRequest.java | 3 +- .../google/genai/types/InlinedResponse.java | 3 +- .../InternalRegisterFilesParameters.java | 3 +- .../java/com/google/genai/types/Interval.java | 3 +- .../java/com/google/genai/types/JobError.java | 3 +- .../genai/types/LLMBasedMetricSpec.java | 3 +- .../com/google/genai/types/LanguageAuto.java | 3 +- .../com/google/genai/types/LanguageHints.java | 3 +- .../java/com/google/genai/types/LatLng.java | 3 +- .../genai/types/ListBatchJobsConfig.java | 3 +- .../genai/types/ListBatchJobsParameters.java | 3 +- .../genai/types/ListBatchJobsResponse.java | 3 +- .../genai/types/ListCachedContentsConfig.java | 3 +- .../types/ListCachedContentsParameters.java | 3 +- .../types/ListCachedContentsResponse.java | 3 +- .../genai/types/ListDocumentsConfig.java | 3 +- .../genai/types/ListDocumentsParameters.java | 3 +- .../genai/types/ListDocumentsResponse.java | 3 +- .../types/ListFileSearchStoresConfig.java | 3 +- .../types/ListFileSearchStoresParameters.java | 3 +- .../types/ListFileSearchStoresResponse.java | 3 +- .../google/genai/types/ListFilesConfig.java | 3 +- .../genai/types/ListFilesParameters.java | 3 +- .../google/genai/types/ListFilesResponse.java | 3 +- .../google/genai/types/ListModelsConfig.java | 3 +- .../genai/types/ListModelsParameters.java | 3 +- .../genai/types/ListModelsResponse.java | 3 +- .../genai/types/ListTuningJobsConfig.java | 3 +- .../genai/types/ListTuningJobsParameters.java | 3 +- .../genai/types/ListTuningJobsResponse.java | 3 +- .../google/genai/types/LiveClientContent.java | 3 +- .../google/genai/types/LiveClientMessage.java | 3 +- .../genai/types/LiveClientRealtimeInput.java | 3 +- .../google/genai/types/LiveClientSetup.java | 3 +- .../genai/types/LiveClientToolResponse.java | 3 +- .../google/genai/types/LiveConnectConfig.java | 3 +- .../genai/types/LiveConnectConstraints.java | 3 +- .../genai/types/LiveConnectParameters.java | 3 +- .../LiveSendClientContentParameters.java | 3 +- .../LiveSendRealtimeInputParameters.java | 3 +- .../types/LiveSendToolResponseParameters.java | 3 +- .../google/genai/types/LiveServerContent.java | 3 +- .../google/genai/types/LiveServerGoAway.java | 3 +- .../google/genai/types/LiveServerMessage.java | 3 +- .../LiveServerSessionResumptionUpdate.java | 3 +- .../genai/types/LiveServerSetupComplete.java | 3 +- .../genai/types/LiveServerToolCall.java | 3 +- .../types/LiveServerToolCallCancellation.java | 3 +- .../google/genai/types/LogprobsResult.java | 3 +- .../genai/types/LogprobsResultCandidate.java | 3 +- .../types/LogprobsResultTopCandidates.java | 3 +- .../genai/types/MaskReferenceConfig.java | 3 +- .../genai/types/MaskReferenceImage.java | 3 +- .../com/google/genai/types/McpServer.java | 3 +- .../java/com/google/genai/types/Metric.java | 3 +- .../genai/types/ModalityTokenCount.java | 3 +- .../java/com/google/genai/types/Model.java | 3 +- .../google/genai/types/ModelArmorConfig.java | 3 +- .../genai/types/ModelSelectionConfig.java | 3 +- .../com/google/genai/types/ModelStatus.java | 3 +- .../genai/types/MultiSpeakerVoiceConfig.java | 3 +- .../com/google/genai/types/OutputConfig.java | 3 +- .../com/google/genai/types/OutputInfo.java | 3 +- .../genai/types/PairwiseMetricResult.java | 3 +- .../genai/types/PairwiseMetricSpec.java | 3 +- .../java/com/google/genai/types/Part.java | 3 +- .../genai/types/PartMediaResolution.java | 3 +- .../com/google/genai/types/PartialArg.java | 3 +- .../genai/types/PartnerModelTuningSpec.java | 3 +- .../genai/types/PointwiseMetricResult.java | 3 +- .../genai/types/PointwiseMetricSpec.java | 3 +- .../com/google/genai/types/PreTunedModel.java | 3 +- .../genai/types/PrebuiltVoiceConfig.java | 3 +- .../genai/types/PredefinedMetricSpec.java | 3 +- .../PreferenceOptimizationDataStats.java | 3 +- ...PreferenceOptimizationHyperParameters.java | 3 +- .../types/PreferenceOptimizationSpec.java | 3 +- .../google/genai/types/ProactivityConfig.java | 3 +- .../com/google/genai/types/ProductImage.java | 3 +- .../com/google/genai/types/ProxyOptions.java | 3 +- .../java/com/google/genai/types/RagChunk.java | 3 +- .../google/genai/types/RagChunkPageSpan.java | 3 +- .../genai/types/RagRetrievalConfig.java | 3 +- .../genai/types/RagRetrievalConfigFilter.java | 3 +- .../types/RagRetrievalConfigHybridSearch.java | 3 +- .../types/RagRetrievalConfigRanking.java | 3 +- .../RagRetrievalConfigRankingLlmRanker.java | 3 +- .../RagRetrievalConfigRankingRankService.java | 3 +- .../com/google/genai/types/RawOutput.java | 3 +- .../google/genai/types/RawReferenceImage.java | 3 +- .../genai/types/RealtimeInputConfig.java | 3 +- .../genai/types/RecontextImageConfig.java | 3 +- .../genai/types/RecontextImageParameters.java | 3 +- .../genai/types/RecontextImageResponse.java | 3 +- .../genai/types/RecontextImageSource.java | 3 +- .../google/genai/types/ReferenceImageAPI.java | 3 +- .../genai/types/RegisterFilesConfig.java | 3 +- .../genai/types/RegisterFilesResponse.java | 3 +- .../ReinforcementTuningAutoraterScorer.java | 3 +- ...TuningAutoraterScorerExactMatchScorer.java | 3 +- ...rScorerParsedResponseConversionScorer.java | 3 +- ...inforcementTuningCloudRunRewardScorer.java | 4 +- ...cementTuningCodeExecutionRewardScorer.java | 4 +- .../types/ReinforcementTuningExample.java | 3 +- .../ReinforcementTuningHyperParameters.java | 3 +- ...einforcementTuningParseResponseConfig.java | 4 +- .../genai/types/ReinforcementTuningSpec.java | 3 +- ...orcementTuningStringMatchRewardScorer.java | 4 +- ...gMatchRewardScorerJsonMatchExpression.java | 3 +- ...atchRewardScorerStringMatchExpression.java | 3 +- ...einforcementTuningUserDatasetExamples.java | 4 +- .../com/google/genai/types/ReplayFile.java | 3 +- .../google/genai/types/ReplayInteraction.java | 3 +- .../com/google/genai/types/ReplayRequest.java | 3 +- .../google/genai/types/ReplayResponse.java | 3 +- .../genai/types/ReplicatedVoiceConfig.java | 3 +- .../google/genai/types/ResponseFormat.java | 3 +- .../com/google/genai/types/Retrieval.java | 3 +- .../google/genai/types/RetrievalConfig.java | 3 +- .../google/genai/types/RetrievalMetadata.java | 3 +- .../google/genai/types/RougeMetricValue.java | 3 +- .../com/google/genai/types/RougeSpec.java | 3 +- .../genai/types/RubricGenerationSpec.java | 3 +- .../google/genai/types/SafetyAttributes.java | 3 +- .../com/google/genai/types/SafetyRating.java | 3 +- .../com/google/genai/types/SafetySetting.java | 3 +- .../java/com/google/genai/types/Schema.java | 3 +- .../com/google/genai/types/ScribbleImage.java | 3 +- .../google/genai/types/SearchEntryPoint.java | 3 +- .../com/google/genai/types/SearchTypes.java | 3 +- .../java/com/google/genai/types/Segment.java | 3 +- .../genai/types/SegmentImageConfig.java | 3 +- .../genai/types/SegmentImageParameters.java | 3 +- .../genai/types/SegmentImageResponse.java | 3 +- .../genai/types/SegmentImageSource.java | 3 +- .../genai/types/SessionResumptionConfig.java | 3 +- .../types/SingleEmbedContentResponse.java | 3 +- ...SingleReinforcementTuningRewardConfig.java | 3 +- .../com/google/genai/types/SlidingWindow.java | 3 +- .../genai/types/SpeakerVoiceConfig.java | 3 +- .../com/google/genai/types/SpeechConfig.java | 3 +- .../genai/types/StreamableHttpTransport.java | 3 +- .../com/google/genai/types/StringList.java | 3 +- .../genai/types/StyleReferenceConfig.java | 3 +- .../genai/types/StyleReferenceImage.java | 3 +- .../genai/types/SubjectReferenceConfig.java | 3 +- .../genai/types/SubjectReferenceImage.java | 3 +- .../types/SupervisedHyperParameters.java | 3 +- .../types/SupervisedTuningDataStats.java | 3 +- .../SupervisedTuningDatasetDistribution.java | 3 +- ...uningDatasetDistributionDatasetBucket.java | 3 +- .../genai/types/SupervisedTuningSpec.java | 3 +- .../com/google/genai/types/TestTableFile.java | 3 +- .../com/google/genai/types/TestTableItem.java | 3 +- .../genai/types/TextResponseFormat.java | 3 +- .../google/genai/types/ThinkingConfig.java | 3 +- .../com/google/genai/types/TokensInfo.java | 3 +- .../java/com/google/genai/types/Tool.java | 3 +- .../java/com/google/genai/types/ToolCall.java | 3 +- .../google/genai/types/ToolCodeExecution.java | 3 +- .../com/google/genai/types/ToolConfig.java | 3 +- .../google/genai/types/ToolExaAiSearch.java | 3 +- .../genai/types/ToolParallelAiSearch.java | 3 +- .../com/google/genai/types/ToolResponse.java | 3 +- .../com/google/genai/types/Transcription.java | 3 +- .../google/genai/types/TranslationConfig.java | 3 +- .../com/google/genai/types/TunedModel.java | 3 +- .../genai/types/TunedModelCheckpoint.java | 3 +- .../google/genai/types/TunedModelInfo.java | 3 +- .../google/genai/types/TuningDataStats.java | 3 +- .../com/google/genai/types/TuningDataset.java | 3 +- .../com/google/genai/types/TuningExample.java | 3 +- .../com/google/genai/types/TuningJob.java | 3 +- .../google/genai/types/TuningJobMetadata.java | 3 +- .../google/genai/types/TuningOperation.java | 3 +- .../genai/types/TuningValidationDataset.java | 3 +- .../com/google/genai/types/UnifiedMetric.java | 3 +- .../types/UpdateCachedContentConfig.java | 3 +- .../types/UpdateCachedContentParameters.java | 3 +- .../google/genai/types/UpdateModelConfig.java | 3 +- .../genai/types/UpdateModelParameters.java | 3 +- .../google/genai/types/UploadFileConfig.java | 3 +- .../types/UploadToFileSearchStoreConfig.java | 3 +- .../UploadToFileSearchStoreOperation.java | 6 +- .../UploadToFileSearchStoreParameters.java | 3 +- .../UploadToFileSearchStoreResponse.java | 3 +- ...oadToFileSearchStoreResumableResponse.java | 4 +- .../genai/types/UpscaleImageAPIConfig.java | 3 +- .../types/UpscaleImageAPIParameters.java | 3 +- .../genai/types/UpscaleImageConfig.java | 3 +- .../genai/types/UpscaleImageParameters.java | 3 +- .../genai/types/UpscaleImageResponse.java | 3 +- .../com/google/genai/types/UrlContext.java | 3 +- .../genai/types/UrlContextMetadata.java | 3 +- .../com/google/genai/types/UrlMetadata.java | 3 +- .../com/google/genai/types/UsageMetadata.java | 3 +- .../genai/types/VeoHyperParameters.java | 3 +- .../google/genai/types/VeoLoraTuningSpec.java | 3 +- .../com/google/genai/types/VeoTuningSpec.java | 3 +- .../google/genai/types/VertexAISearch.java | 3 +- .../types/VertexAISearchDataStoreSpec.java | 3 +- .../VertexMultimodalDatasetDestination.java | 3 +- .../google/genai/types/VertexRagStore.java | 3 +- .../types/VertexRagStoreRagResource.java | 3 +- .../java/com/google/genai/types/Video.java | 3 +- .../genai/types/VideoGenerationMask.java | 3 +- .../types/VideoGenerationReferenceImage.java | 3 +- .../com/google/genai/types/VideoMetadata.java | 3 +- .../genai/types/VideoResponseFormat.java | 3 +- .../com/google/genai/types/VoiceActivity.java | 3 +- .../types/VoiceActivityDetectionSignal.java | 3 +- .../com/google/genai/types/VoiceConfig.java | 3 +- .../genai/types/VoiceConsentSignature.java | 3 +- .../com/google/genai/types/WebSearch.java | 3 +- .../com/google/genai/types/WebhookConfig.java | 3 +- .../google/genai/types/WhiteSpaceConfig.java | 3 +- .../java/com/google/genai/types/WordInfo.java | 3 +- 474 files changed, 2084 insertions(+), 1778 deletions(-) diff --git a/src/main/java/com/google/genai/AfcUtil.java b/src/main/java/com/google/genai/AfcUtil.java index 8ff11ce0ac8..dd5926f5dab 100644 --- a/src/main/java/com/google/genai/AfcUtil.java +++ b/src/main/java/com/google/genai/AfcUtil.java @@ -60,9 +60,9 @@ static GenerateContentConfig transformGenerateContentConfig(GenerateContentConfi config.tools().get().stream() .map(tool -> Transformers.tTool(tool)) .collect(toImmutableList()); - ObjectNode configNode = JsonSerializable.objectMapper.valueToTree(config); - configNode.set("tools", JsonSerializable.objectMapper.valueToTree(transformedTools)); - transformedConfig = JsonSerializable.fromJsonNode(configNode, GenerateContentConfig.class); + ObjectNode configNode = Common.objectMapper.valueToTree(config); + configNode.set("tools", Common.objectMapper.valueToTree(transformedTools)); + transformedConfig = Common.fromJsonNode(configNode, GenerateContentConfig.class); } else { transformedConfig = config; } diff --git a/src/main/java/com/google/genai/AsyncBatches.java b/src/main/java/com/google/genai/AsyncBatches.java index 071704c5887..eddfb44b49c 100644 --- a/src/main/java/com/google/genai/AsyncBatches.java +++ b/src/main/java/com/google/genai/AsyncBatches.java @@ -175,14 +175,14 @@ public CompletableFuture> list(ListBatchJobsConfig config) + requestConfig.getClass().getName()); } return this.privateList((ListBatchJobsConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + .thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.BATCH_JOBS, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } diff --git a/src/main/java/com/google/genai/AsyncCaches.java b/src/main/java/com/google/genai/AsyncCaches.java index 7fdb067aca5..2eca6e66636 100644 --- a/src/main/java/com/google/genai/AsyncCaches.java +++ b/src/main/java/com/google/genai/AsyncCaches.java @@ -160,14 +160,14 @@ public CompletableFuture> list(ListCachedContentsConfi + requestConfig.getClass().getName()); } return this.privateList((ListCachedContentsConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + .thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.CACHED_CONTENTS, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } } diff --git a/src/main/java/com/google/genai/AsyncDocuments.java b/src/main/java/com/google/genai/AsyncDocuments.java index fbc2917edf1..7a246a37683 100644 --- a/src/main/java/com/google/genai/AsyncDocuments.java +++ b/src/main/java/com/google/genai/AsyncDocuments.java @@ -102,14 +102,14 @@ public CompletableFuture> list(String parent, ListDocuments + requestConfig.getClass().getName()); } return this.privateList(parent, (ListDocumentsConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + .thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.DOCUMENTS, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } } diff --git a/src/main/java/com/google/genai/AsyncFileSearchStores.java b/src/main/java/com/google/genai/AsyncFileSearchStores.java index 315caabf68f..b5adbdf7ec9 100644 --- a/src/main/java/com/google/genai/AsyncFileSearchStores.java +++ b/src/main/java/com/google/genai/AsyncFileSearchStores.java @@ -163,14 +163,14 @@ public CompletableFuture> list(ListFileSearchStoresC + requestConfig.getClass().getName()); } return this.privateList((ListFileSearchStoresConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + .thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.FILE_SEARCH_STORES, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } diff --git a/src/main/java/com/google/genai/AsyncFiles.java b/src/main/java/com/google/genai/AsyncFiles.java index 96b84bafaee..85cfd995564 100644 --- a/src/main/java/com/google/genai/AsyncFiles.java +++ b/src/main/java/com/google/genai/AsyncFiles.java @@ -157,15 +157,14 @@ public CompletableFuture> list(ListFilesConfig config) { "Internal error: Pager expected ListFilesConfig but received " + requestConfig.getClass().getName()); } - return this.privateList((ListFilesConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + return this.privateList((ListFilesConfig) requestConfig).thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.FILES, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } diff --git a/src/main/java/com/google/genai/AsyncLive.java b/src/main/java/com/google/genai/AsyncLive.java index e3eea728fff..963d5c18e28 100644 --- a/src/main/java/com/google/genai/AsyncLive.java +++ b/src/main/java/com/google/genai/AsyncLive.java @@ -194,7 +194,7 @@ private String getSetupRequest(String model, LiveConnectConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; if (this.apiClient.vertexAI()) { @@ -206,7 +206,7 @@ private String getSetupRequest(String model, LiveConnectConfig config) { // TODO: Remove the hack that removes config. body.remove("config"); - return JsonSerializable.toJsonString(body); + return Common.toJsonString(body); } static class GenAiWebSocketClient extends WebSocketListener { @@ -336,12 +336,12 @@ private void handleIncomingMessage(String message) { if (messageCallback != null) { try { LiveConverters liveConverters = new LiveConverters(this.apiClient); - JsonNode responseNode = JsonSerializable.stringToJsonNode(message); + JsonNode responseNode = Common.stringToJsonNode(message); if (this.apiClient.vertexAI()) { responseNode = liveConverters.liveServerMessageFromVertex(responseNode, null); } LiveServerMessage serverMessage = - JsonSerializable.fromJsonNode(responseNode, LiveServerMessage.class); + Common.fromJsonNode(responseNode, LiveServerMessage.class); messageCallback.accept(serverMessage); } catch (RuntimeException e) { logger.log(Level.SEVERE, "Error deserializing message", e); diff --git a/src/main/java/com/google/genai/AsyncModels.java b/src/main/java/com/google/genai/AsyncModels.java index 8f4d660a3b1..a3436555af4 100644 --- a/src/main/java/com/google/genai/AsyncModels.java +++ b/src/main/java/com/google/genai/AsyncModels.java @@ -108,7 +108,7 @@ CompletableFuture privateGenerateContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateGenerateContent(model, contents, config); return this.apiClient @@ -134,7 +134,7 @@ CompletableFuture> privateGenerateConten if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateGenerateContentStream(model, contents, config); return this.apiClient @@ -170,7 +170,7 @@ CompletableFuture privateEmbedContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateEmbedContent( model, contents, content, embeddingApiType, config); @@ -198,7 +198,7 @@ CompletableFuture privateGenerateImages( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateGenerateImages(model, prompt, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -230,7 +230,7 @@ CompletableFuture privateEditImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateEditImage(model, prompt, referenceImages, config); return this.apiClient @@ -260,7 +260,7 @@ CompletableFuture privateUpscaleImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateUpscaleImage(model, image, upscaleFactor, config); return this.apiClient @@ -302,7 +302,7 @@ public CompletableFuture recontextImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForRecontextImage(model, source, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -340,7 +340,7 @@ public CompletableFuture segmentImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForSegmentImage(model, source, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -366,7 +366,7 @@ public CompletableFuture get(String model, GetModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForGet(model, config); return this.apiClient .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -384,7 +384,7 @@ CompletableFuture privateList(ListModelsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateList(config); return this.apiClient .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -416,7 +416,7 @@ public CompletableFuture update(String model, UpdateModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForUpdate(model, config); return this.apiClient .asyncRequest("patch", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -442,7 +442,7 @@ public CompletableFuture delete(String model, DeleteModelCo if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForDelete(model, config); return this.apiClient .asyncRequest( @@ -479,7 +479,7 @@ public CompletableFuture countTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForCountTokens(model, contents, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -515,7 +515,7 @@ public CompletableFuture computeTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForComputeTokens(model, contents, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -555,7 +555,7 @@ CompletableFuture privateGenerateVideos( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = models.buildRequestForPrivateGenerateVideos(model, prompt, image, video, source, config); return this.apiClient diff --git a/src/main/java/com/google/genai/AsyncPager.java b/src/main/java/com/google/genai/AsyncPager.java index a87b8f6a2dd..8354c24d3f7 100644 --- a/src/main/java/com/google/genai/AsyncPager.java +++ b/src/main/java/com/google/genai/AsyncPager.java @@ -67,9 +67,7 @@ public CompletableFuture> nextPage() { } try { return asyncRequest - .apply( - JsonSerializable.fromJsonNode( - requestConfig, pagedItem.requestConfigClass())) + .apply(Common.fromJsonNode(requestConfig, pagedItem.requestConfigClass())) .thenApply( response -> { initNewPage((JsonNode) response); diff --git a/src/main/java/com/google/genai/AsyncSession.java b/src/main/java/com/google/genai/AsyncSession.java index 737369f7d10..f870c934cce 100644 --- a/src/main/java/com/google/genai/AsyncSession.java +++ b/src/main/java/com/google/genai/AsyncSession.java @@ -21,11 +21,11 @@ import com.google.genai.types.LiveClientContent; import com.google.genai.types.LiveClientMessage; import com.google.genai.types.LiveClientToolResponse; -import com.google.genai.types.LiveServerSetupComplete; import com.google.genai.types.LiveSendClientContentParameters; import com.google.genai.types.LiveSendRealtimeInputParameters; import com.google.genai.types.LiveSendToolResponseParameters; import com.google.genai.types.LiveServerMessage; +import com.google.genai.types.LiveServerSetupComplete; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; @@ -105,7 +105,7 @@ public CompletableFuture sendToolResponse(LiveSendToolResponseParameters t private CompletableFuture send(LiveClientMessage input) { LiveConverters liveConverters = new LiveConverters(apiClient); - JsonNode parameterNode = JsonSerializable.toJsonNode(input); + JsonNode parameterNode = Common.toJsonNode(input); ObjectNode body; if (this.apiClient.vertexAI()) { @@ -114,7 +114,7 @@ private CompletableFuture send(LiveClientMessage input) { body = liveConverters.liveClientMessageToMldev(parameterNode, null); } - return CompletableFuture.runAsync(() -> websocket.send(JsonSerializable.toJsonString(body))); + return CompletableFuture.runAsync(() -> websocket.send(Common.toJsonString(body))); } /** diff --git a/src/main/java/com/google/genai/AsyncTunings.java b/src/main/java/com/google/genai/AsyncTunings.java index 8343fb39e9e..9f663bacd6a 100644 --- a/src/main/java/com/google/genai/AsyncTunings.java +++ b/src/main/java/com/google/genai/AsyncTunings.java @@ -60,7 +60,7 @@ CompletableFuture privateGet(String name, GetTuningJobConfig config) if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = tunings.buildRequestForPrivateGet(name, config); return this.apiClient .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -78,7 +78,7 @@ CompletableFuture privateList(ListTuningJobsConfig confi if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = tunings.buildRequestForPrivateList(config); return this.apiClient .asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -107,7 +107,7 @@ public CompletableFuture cancel( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = tunings.buildRequestForCancel(name, config); return this.apiClient .asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions()) @@ -139,7 +139,7 @@ CompletableFuture privateTune( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = tunings.buildRequestForPrivateTune(baseModel, preTunedModel, trainingDataset, config); return this.apiClient @@ -172,7 +172,7 @@ CompletableFuture privateTuneMldev( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = tunings.buildRequestForPrivateTuneMldev(baseModel, preTunedModel, trainingDataset, config); return this.apiClient @@ -207,14 +207,14 @@ public CompletableFuture> list(ListTuningJobsConfig config + requestConfig.getClass().getName()); } return this.privateList((ListTuningJobsConfig) requestConfig) - .thenApply(JsonSerializable::toJsonNode); + .thenApply(Common::toJsonNode); }; return CompletableFuture.supplyAsync( () -> new AsyncPager( Pager.PagedItem.TUNING_JOBS, request, - (ObjectNode) JsonSerializable.toJsonNode(finalConfig), + (ObjectNode) Common.toJsonNode(finalConfig), request.apply(finalConfig))); } diff --git a/src/main/java/com/google/genai/BasePager.java b/src/main/java/com/google/genai/BasePager.java index cdae046ec63..904bf881249 100644 --- a/src/main/java/com/google/genai/BasePager.java +++ b/src/main/java/com/google/genai/BasePager.java @@ -113,13 +113,13 @@ protected void initNewPage(JsonNode response) { } else { List page = new ArrayList<>(); for (JsonNode responseItem : responseList) { - page.add((T) JsonSerializable.fromJsonNode(responseItem, pagedItem.itemClass())); + page.add((T) Common.fromJsonNode(responseItem, pagedItem.itemClass())); } this.page = ImmutableList.copyOf(page); } try { this.sdkHttpResponse = - JsonSerializable.fromJsonNode(response.get("sdkHttpResponse"), HttpResponse.class); + Common.fromJsonNode(response.get("sdkHttpResponse"), HttpResponse.class); } catch (GenAiIOException e) { this.sdkHttpResponse = null; } diff --git a/src/main/java/com/google/genai/Batches.java b/src/main/java/com/google/genai/Batches.java index f511581e350..e9775cbe010 100644 --- a/src/main/java/com/google/genai/Batches.java +++ b/src/main/java/com/google/genai/Batches.java @@ -66,7 +66,7 @@ public Batches(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"apiKey"}) != null) { Common.setValueByPath( toObject, @@ -116,7 +116,7 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode batchJobDestinationFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"responsesFile"}) != null) { Common.setValueByPath( @@ -135,7 +135,7 @@ ObjectNode batchJobDestinationFromMldev(JsonNode fromObject, ObjectNode parentOb ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(inlinedResponseFromMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(inlinedResponseFromMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"inlinedResponses"}, result); } @@ -155,7 +155,7 @@ ObjectNode batchJobDestinationFromMldev(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode batchJobDestinationFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"predictionsFormat"}) != null) { Common.setValueByPath( toObject, @@ -185,7 +185,7 @@ ObjectNode batchJobDestinationFromVertex(JsonNode fromObject, ObjectNode parentO toObject, new String[] {"vertexDataset"}, vertexMultimodalDatasetDestinationFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"vertexMultimodalDatasetDestination"})), toObject)); @@ -196,7 +196,7 @@ ObjectNode batchJobDestinationFromVertex(JsonNode fromObject, ObjectNode parentO @ExcludeFromGeneratedCoverageReport ObjectNode batchJobDestinationToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"format"}) != null) { Common.setValueByPath( toObject, @@ -242,8 +242,7 @@ ObjectNode batchJobDestinationToVertex(JsonNode fromObject, ObjectNode parentObj toObject, new String[] {"vertexMultimodalDatasetDestination"}, vertexMultimodalDatasetDestinationToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"vertexDataset"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"vertexDataset"})), toObject)); } @@ -252,7 +251,7 @@ ObjectNode batchJobDestinationToVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode batchJobFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -308,7 +307,7 @@ ObjectNode batchJobFromMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"dest"}, batchJobDestinationFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tRecvBatchJobDestination( Common.getValueByPath(fromObject, new String[] {"metadata", "output"}))), toObject)); @@ -319,7 +318,7 @@ ObjectNode batchJobFromMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode batchJobFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -388,8 +387,7 @@ ObjectNode batchJobFromVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"src"}, batchJobSourceFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inputConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inputConfig"})), toObject)); } @@ -398,7 +396,7 @@ ObjectNode batchJobFromVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"dest"}, batchJobDestinationFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tRecvBatchJobDestination( Common.getValueByPath(fromObject, new String[] {"outputConfig"}))), toObject)); @@ -423,7 +421,7 @@ ObjectNode batchJobFromVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode batchJobSourceFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"instancesFormat"}) != null) { Common.setValueByPath( toObject, @@ -461,7 +459,7 @@ ObjectNode batchJobSourceFromVertex(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode batchJobSourceToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"format"}))) { throw new IllegalArgumentException( "format parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -494,7 +492,7 @@ ObjectNode batchJobSourceToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(inlinedRequestToMldev(apiClient, JsonSerializable.toJsonNode(item), toObject)); + result.add(inlinedRequestToMldev(apiClient, Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"requests", "requests"}, result); } @@ -510,7 +508,7 @@ ObjectNode batchJobSourceToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode batchJobSourceToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"format"}) != null) { Common.setValueByPath( toObject, @@ -556,7 +554,7 @@ ObjectNode batchJobSourceToVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) { Common.setValueByPath( toObject, @@ -583,7 +581,7 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode cancelBatchJobParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -598,7 +596,7 @@ ObjectNode cancelBatchJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode cancelBatchJobParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -612,7 +610,7 @@ ObjectNode cancelBatchJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"content"}) != null) { Common.setValueByPath( toObject, @@ -625,7 +623,7 @@ ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"citationMetadata"}, citationMetadataFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"citationMetadata"})), toObject)); } @@ -691,7 +689,7 @@ ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode citationMetadataFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"citationSources"}) != null) { Common.setValueByPath( toObject, @@ -704,14 +702,14 @@ ObjectNode citationMetadataFromMldev(JsonNode fromObject, ObjectNode parentObjec @ExcludeFromGeneratedCoverageReport ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -728,7 +726,7 @@ ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode createBatchJobConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -755,7 +753,7 @@ ObjectNode createBatchJobConfigToMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode createBatchJobConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -769,7 +767,7 @@ ObjectNode createBatchJobConfigToVertex(JsonNode fromObject, ObjectNode parentOb parentObject, new String[] {"outputConfig"}, batchJobDestinationToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tBatchJobDestination( Common.getValueByPath(fromObject, new String[] {"dest"}))), toObject)); @@ -787,7 +785,7 @@ ObjectNode createBatchJobConfigToVertex(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode createBatchJobParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -802,7 +800,7 @@ ObjectNode createBatchJobParametersToMldev( new String[] {"batch", "inputConfig"}, batchJobSourceToMldev( apiClient, - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tBatchJobSource( Common.getValueByPath(fromObject, new String[] {"src"}))), toObject)); @@ -811,8 +809,7 @@ ObjectNode createBatchJobParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createBatchJobConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -822,7 +819,7 @@ ObjectNode createBatchJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createBatchJobParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -836,7 +833,7 @@ ObjectNode createBatchJobParametersToVertex( toObject, new String[] {"inputConfig"}, batchJobSourceToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tBatchJobSource( Common.getValueByPath(fromObject, new String[] {"src"}))), toObject)); @@ -845,8 +842,7 @@ ObjectNode createBatchJobParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createBatchJobConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -855,7 +851,7 @@ ObjectNode createBatchJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode createEmbeddingsBatchJobConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -870,7 +866,7 @@ ObjectNode createEmbeddingsBatchJobConfigToMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode createEmbeddingsBatchJobParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -885,15 +881,14 @@ ObjectNode createEmbeddingsBatchJobParametersToMldev( new String[] {"batch", "inputConfig"}, embeddingsBatchJobSourceToMldev( apiClient, - JsonSerializable.toJsonNode(Common.getValueByPath(fromObject, new String[] {"src"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"src"})), toObject)); } if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createEmbeddingsBatchJobConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -903,7 +898,7 @@ ObjectNode createEmbeddingsBatchJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteBatchJobParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -918,7 +913,7 @@ ObjectNode deleteBatchJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteBatchJobParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -932,7 +927,7 @@ ObjectNode deleteBatchJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode deleteResourceJobFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -966,7 +961,7 @@ ObjectNode deleteResourceJobFromMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode deleteResourceJobFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1001,7 +996,7 @@ ObjectNode deleteResourceJobFromVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode embedContentBatchToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"contents"}) != null) { Common.setValueByPath( toObject, @@ -1015,8 +1010,7 @@ ObjectNode embedContentBatchToMldev( toObject, new String[] {"_self"}, embedContentConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject)); Common.moveValueByPath(toObject, ImmutableMap.of("requests[].*", "requests[].request.*")); } @@ -1026,7 +1020,7 @@ ObjectNode embedContentBatchToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"taskType"}) != null) { Common.setValueByPath( parentObject, @@ -1078,7 +1072,7 @@ ObjectNode embedContentConfigToMldev(JsonNode fromObject, ObjectNode parentObjec @ExcludeFromGeneratedCoverageReport ObjectNode embeddingsBatchJobSourceToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"fileName"}) != null) { Common.setValueByPath( toObject, @@ -1092,7 +1086,7 @@ ObjectNode embeddingsBatchJobSourceToMldev( new String[] {"requests"}, embedContentBatchToMldev( apiClient, - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"inlinedRequests"})), toObject)); } @@ -1102,7 +1096,7 @@ ObjectNode embeddingsBatchJobSourceToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) { throw new IllegalArgumentException( "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -1128,7 +1122,7 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) { Common.setValueByPath( toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"})); @@ -1165,7 +1159,7 @@ ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallingConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"allowedFunctionNames"}) != null) { Common.setValueByPath( toObject, @@ -1193,14 +1187,14 @@ ObjectNode functionCallingConfigToMldev(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode generateContentConfigToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"systemInstruction"}) != null) { Common.setValueByPath( parentObject, new String[] {"systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -1323,7 +1317,7 @@ ObjectNode generateContentConfigToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(safetySettingToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(safetySettingToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"safetySettings"}, result); } @@ -1336,7 +1330,7 @@ ObjectNode generateContentConfigToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToMldev(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToMldev(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -1346,8 +1340,7 @@ ObjectNode generateContentConfigToMldev( parentObject, new String[] {"toolConfig"}, toolConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"toolConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"toolConfig"})), toObject)); } @@ -1405,8 +1398,7 @@ ObjectNode generateContentConfigToMldev( toObject, new String[] {"imageConfig"}, imageConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"imageConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"imageConfig"})), toObject)); } @@ -1442,7 +1434,7 @@ ObjectNode generateContentConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1457,7 +1449,7 @@ ObjectNode generateContentResponseFromMldev(JsonNode fromObject, ObjectNode pare ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(candidateFromMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(candidateFromMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"candidates"}, result); } @@ -1503,7 +1495,7 @@ ObjectNode generateContentResponseFromMldev(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode getBatchJobParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1518,7 +1510,7 @@ ObjectNode getBatchJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode getBatchJobParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1532,14 +1524,13 @@ ObjectNode getBatchJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"authConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"authConfig"}, authConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"authConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"authConfig"})), toObject)); } @@ -1561,7 +1552,7 @@ ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"searchTypes"}) != null) { Common.setValueByPath( toObject, @@ -1593,7 +1584,7 @@ ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode imageConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"aspectRatio"}) != null) { Common.setValueByPath( toObject, @@ -1645,7 +1636,7 @@ ObjectNode imageConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode inlinedRequestToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -1662,7 +1653,7 @@ ObjectNode inlinedRequestToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(contentToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"request", "contents"}, result); } @@ -1680,8 +1671,7 @@ ObjectNode inlinedRequestToMldev( new String[] {"request", "generationConfig"}, generateContentConfigToMldev( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), (ObjectNode) Common.getValueByPath( toObject, @@ -1694,14 +1684,13 @@ ObjectNode inlinedRequestToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode inlinedResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"response"}) != null) { Common.setValueByPath( toObject, new String[] {"response"}, generateContentResponseFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -1724,7 +1713,7 @@ ObjectNode inlinedResponseFromMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -1751,7 +1740,7 @@ ObjectNode listBatchJobsConfigToMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -1779,12 +1768,11 @@ ObjectNode listBatchJobsConfigToVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listBatchJobsConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -1793,12 +1781,11 @@ ObjectNode listBatchJobsParametersToMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listBatchJobsConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -1807,7 +1794,7 @@ ObjectNode listBatchJobsParametersToVertex(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1829,7 +1816,7 @@ ObjectNode listBatchJobsResponseFromMldev(JsonNode fromObject, ObjectNode parent ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(batchJobFromMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(batchJobFromMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"batchJobs"}, result); } @@ -1839,7 +1826,7 @@ ObjectNode listBatchJobsResponseFromMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode listBatchJobsResponseFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1861,7 +1848,7 @@ ObjectNode listBatchJobsResponseFromVertex(JsonNode fromObject, ObjectNode paren ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(batchJobFromVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(batchJobFromVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"batchJobs"}, result); } @@ -1871,7 +1858,7 @@ ObjectNode listBatchJobsResponseFromVertex(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -1898,8 +1885,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"fileData"}, fileDataToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"fileData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"fileData"})), toObject)); } @@ -1908,8 +1894,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCall"}, functionCallToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"functionCall"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"functionCall"})), toObject)); } @@ -1925,8 +1910,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"inlineData"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inlineData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inlineData"})), toObject)); } @@ -1991,7 +1975,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"category"}) != null) { Common.setValueByPath( toObject, @@ -2017,7 +2001,7 @@ ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrievalConfig"}) != null) { Common.setValueByPath( toObject, @@ -2030,7 +2014,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCallingConfig"}, functionCallingConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"functionCallingConfig"})), toObject)); } @@ -2048,7 +2032,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"retrieval"}))) { throw new IllegalArgumentException( "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -2074,8 +2058,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleSearch"}, googleSearchToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleSearch"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleSearch"})), toObject)); } @@ -2084,8 +2067,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleMaps"}, googleMapsToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleMaps"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleMaps"})), toObject)); } @@ -2148,7 +2130,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode vertexMultimodalDatasetDestinationFromVertex( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"bigqueryDestination", "outputUri"}) != null) { Common.setValueByPath( @@ -2170,7 +2152,7 @@ ObjectNode vertexMultimodalDatasetDestinationFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode vertexMultimodalDatasetDestinationToVertex( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"bigqueryDestination"}) != null) { Common.setValueByPath( toObject, @@ -2203,7 +2185,7 @@ BuiltRequest buildRequestForPrivateCreate( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2232,7 +2214,7 @@ BuiltRequest buildRequestForPrivateCreate( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2245,7 +2227,7 @@ BatchJob processResponseForPrivateCreate(ApiResponse response, CreateBatchJobCon throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = batchJobFromVertex(responseNode, null); @@ -2255,7 +2237,7 @@ BatchJob processResponseForPrivateCreate(ApiResponse response, CreateBatchJobCon responseNode = batchJobFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, BatchJob.class); + return Common.fromJsonNode(responseNode, BatchJob.class); } BatchJob privateCreate(String model, BatchJobSource src, CreateBatchJobConfig config) { @@ -2284,7 +2266,7 @@ BuiltRequest buildRequestForPrivateCreateEmbeddings( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2314,7 +2296,7 @@ BuiltRequest buildRequestForPrivateCreateEmbeddings( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2328,7 +2310,7 @@ BatchJob processResponseForPrivateCreateEmbeddings( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -2340,7 +2322,7 @@ BatchJob processResponseForPrivateCreateEmbeddings( responseNode = batchJobFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, BatchJob.class); + return Common.fromJsonNode(responseNode, BatchJob.class); } BatchJob privateCreateEmbeddings( @@ -2365,7 +2347,7 @@ BuiltRequest buildRequestForGet(String name, GetBatchJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2394,7 +2376,7 @@ BuiltRequest buildRequestForGet(String name, GetBatchJobConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2407,7 +2389,7 @@ BatchJob processResponseForGet(ApiResponse response, GetBatchJobConfig config) { throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = batchJobFromVertex(responseNode, null); @@ -2417,7 +2399,7 @@ BatchJob processResponseForGet(ApiResponse response, GetBatchJobConfig config) { responseNode = batchJobFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, BatchJob.class); + return Common.fromJsonNode(responseNode, BatchJob.class); } /** @@ -2451,7 +2433,7 @@ BuiltRequest buildRequestForCancel(String name, CancelBatchJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2480,7 +2462,7 @@ BuiltRequest buildRequestForCancel(String name, CancelBatchJobConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** @@ -2509,7 +2491,7 @@ BuiltRequest buildRequestForPrivateList(ListBatchJobsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2538,7 +2520,7 @@ BuiltRequest buildRequestForPrivateList(ListBatchJobsConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2552,7 +2534,7 @@ ListBatchJobsResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = listBatchJobsResponseFromVertex(responseNode, null); @@ -2563,7 +2545,7 @@ ListBatchJobsResponse processResponseForPrivateList( } ListBatchJobsResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ListBatchJobsResponse.class); + Common.fromJsonNode(responseNode, ListBatchJobsResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2596,7 +2578,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteBatchJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2625,7 +2607,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteBatchJobConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2638,7 +2620,7 @@ DeleteResourceJob processResponseForDelete(ApiResponse response, DeleteBatchJobC throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = deleteResourceJobFromVertex(responseNode, null); @@ -2648,8 +2630,7 @@ DeleteResourceJob processResponseForDelete(ApiResponse response, DeleteBatchJobC responseNode = deleteResourceJobFromMldev(responseNode, null); } - DeleteResourceJob sdkResponse = - JsonSerializable.fromJsonNode(responseNode, DeleteResourceJob.class); + DeleteResourceJob sdkResponse = Common.fromJsonNode(responseNode, DeleteResourceJob.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2704,8 +2685,8 @@ public Pager list(ListBatchJobsConfig config) { return new Pager<>( Pager.PagedItem.BATCH_JOBS, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(config))); } /** diff --git a/src/main/java/com/google/genai/Caches.java b/src/main/java/com/google/genai/Caches.java index 22fd5db71a7..a2f4f585005 100644 --- a/src/main/java/com/google/genai/Caches.java +++ b/src/main/java/com/google/genai/Caches.java @@ -61,7 +61,7 @@ public Caches(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"apiKey"}) != null) { Common.setValueByPath( toObject, @@ -111,7 +111,7 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) { Common.setValueByPath( toObject, @@ -137,7 +137,7 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode codeExecutionResultToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outcome"}) != null) { Common.setValueByPath( toObject, @@ -163,7 +163,7 @@ ObjectNode codeExecutionResultToVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode computerUseToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"environment"}) != null) { Common.setValueByPath( toObject, @@ -198,14 +198,14 @@ ObjectNode computerUseToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -222,14 +222,14 @@ ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -246,7 +246,7 @@ ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { Common.setValueByPath( @@ -277,7 +277,7 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(contentToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"contents"}, result); } @@ -287,7 +287,7 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare parentObject, new String[] {"systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -299,7 +299,7 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(toolToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -309,8 +309,7 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare parentObject, new String[] {"toolConfig"}, toolConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"toolConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"toolConfig"})), toObject)); } @@ -325,7 +324,7 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { Common.setValueByPath( @@ -356,7 +355,7 @@ ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(contentToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"contents"}, result); } @@ -366,7 +365,7 @@ ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par parentObject, new String[] {"systemInstruction"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -378,7 +377,7 @@ ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(toolToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -388,8 +387,7 @@ ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par parentObject, new String[] {"toolConfig"}, toolConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"toolConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"toolConfig"})), toObject)); } @@ -406,7 +404,7 @@ ObjectNode createCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par @ExcludeFromGeneratedCoverageReport ObjectNode createCachedContentParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -418,8 +416,7 @@ ObjectNode createCachedContentParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createCachedContentConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -429,7 +426,7 @@ ObjectNode createCachedContentParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createCachedContentParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -441,8 +438,7 @@ ObjectNode createCachedContentParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createCachedContentConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -452,7 +448,7 @@ ObjectNode createCachedContentParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode deleteCachedContentParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -467,7 +463,7 @@ ObjectNode deleteCachedContentParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteCachedContentParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -481,7 +477,7 @@ ObjectNode deleteCachedContentParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode deleteCachedContentResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -494,7 +490,7 @@ ObjectNode deleteCachedContentResponseFromMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode deleteCachedContentResponseFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -507,7 +503,7 @@ ObjectNode deleteCachedContentResponseFromVertex(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode executableCodeToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"code"}) != null) { Common.setValueByPath( toObject, @@ -533,7 +529,7 @@ ObjectNode executableCodeToVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) { throw new IllegalArgumentException( "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -559,7 +555,7 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) { Common.setValueByPath( toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"})); @@ -596,7 +592,7 @@ ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallingConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"allowedFunctionNames"}) != null) { Common.setValueByPath( toObject, @@ -624,7 +620,7 @@ ObjectNode functionCallingConfigToMldev(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode getCachedContentParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -639,7 +635,7 @@ ObjectNode getCachedContentParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode getCachedContentParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -653,14 +649,13 @@ ObjectNode getCachedContentParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"authConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"authConfig"}, authConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"authConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"authConfig"})), toObject)); } @@ -682,7 +677,7 @@ ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"searchTypes"}) != null) { Common.setValueByPath( toObject, @@ -714,7 +709,7 @@ ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -735,7 +730,7 @@ ObjectNode listCachedContentsConfigToMldev(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -756,12 +751,11 @@ ObjectNode listCachedContentsConfigToVertex(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listCachedContentsConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -770,12 +764,11 @@ ObjectNode listCachedContentsParametersToMldev(JsonNode fromObject, ObjectNode p @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listCachedContentsConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -784,7 +777,7 @@ ObjectNode listCachedContentsParametersToVertex(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -811,7 +804,7 @@ ObjectNode listCachedContentsResponseFromMldev(JsonNode fromObject, ObjectNode p @ExcludeFromGeneratedCoverageReport ObjectNode listCachedContentsResponseFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -838,7 +831,7 @@ ObjectNode listCachedContentsResponseFromVertex(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"name"}))) { throw new IllegalArgumentException( "name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise" @@ -857,7 +850,7 @@ ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -884,8 +877,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"fileData"}, fileDataToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"fileData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"fileData"})), toObject)); } @@ -894,8 +886,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCall"}, functionCallToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"functionCall"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"functionCall"})), toObject)); } @@ -911,8 +902,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"inlineData"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inlineData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inlineData"})), toObject)); } @@ -977,7 +967,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -990,7 +980,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"codeExecutionResult"}, codeExecutionResultToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"})), toObject)); } @@ -1000,8 +990,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"executableCode"}, executableCodeToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"executableCode"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"executableCode"})), toObject)); } @@ -1091,7 +1080,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrievalConfig"}) != null) { Common.setValueByPath( toObject, @@ -1104,7 +1093,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCallingConfig"}, functionCallingConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"functionCallingConfig"})), toObject)); } @@ -1122,7 +1111,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrievalConfig"}) != null) { Common.setValueByPath( toObject, @@ -1149,7 +1138,7 @@ ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"retrieval"}))) { throw new IllegalArgumentException( "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -1175,8 +1164,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleSearch"}, googleSearchToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleSearch"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleSearch"})), toObject)); } @@ -1185,8 +1173,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleMaps"}, googleMapsToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleMaps"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleMaps"})), toObject)); } @@ -1248,7 +1235,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrieval"}) != null) { Common.setValueByPath( toObject, @@ -1261,8 +1248,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"computerUse"}, computerUseToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"computerUse"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"computerUse"})), toObject)); } @@ -1335,7 +1321,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(mcpServerToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(mcpServerToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"mcpServers"}, result); } @@ -1352,7 +1338,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode updateCachedContentConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { Common.setValueByPath( @@ -1373,7 +1359,7 @@ ObjectNode updateCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode updateCachedContentConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"ttl"}) != null) { Common.setValueByPath( @@ -1395,7 +1381,7 @@ ObjectNode updateCachedContentConfigToVertex(JsonNode fromObject, ObjectNode par @ExcludeFromGeneratedCoverageReport ObjectNode updateCachedContentParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1407,8 +1393,7 @@ ObjectNode updateCachedContentParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = updateCachedContentConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -1418,7 +1403,7 @@ ObjectNode updateCachedContentParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode updateCachedContentParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1430,8 +1415,7 @@ ObjectNode updateCachedContentParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = updateCachedContentConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -1450,7 +1434,7 @@ BuiltRequest buildRequestForCreate(String model, CreateCachedContentConfig confi if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -1479,7 +1463,7 @@ BuiltRequest buildRequestForCreate(String model, CreateCachedContentConfig confi requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -1492,9 +1476,9 @@ CachedContent processResponseForCreate(ApiResponse response, CreateCachedContent throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); - return JsonSerializable.fromJsonNode(responseNode, CachedContent.class); + return Common.fromJsonNode(responseNode, CachedContent.class); } /** @@ -1525,7 +1509,7 @@ BuiltRequest buildRequestForGet(String name, GetCachedContentConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -1554,7 +1538,7 @@ BuiltRequest buildRequestForGet(String name, GetCachedContentConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -1567,9 +1551,9 @@ CachedContent processResponseForGet(ApiResponse response, GetCachedContentConfig throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); - return JsonSerializable.fromJsonNode(responseNode, CachedContent.class); + return Common.fromJsonNode(responseNode, CachedContent.class); } /** @@ -1601,7 +1585,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteCachedContentConfig config if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -1630,7 +1614,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteCachedContentConfig config requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -1644,7 +1628,7 @@ DeleteCachedContentResponse processResponseForDelete( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = deleteCachedContentResponseFromVertex(responseNode, null); @@ -1655,7 +1639,7 @@ DeleteCachedContentResponse processResponseForDelete( } DeleteCachedContentResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, DeleteCachedContentResponse.class); + Common.fromJsonNode(responseNode, DeleteCachedContentResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -1695,7 +1679,7 @@ BuiltRequest buildRequestForUpdate(String name, UpdateCachedContentConfig config if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -1724,7 +1708,7 @@ BuiltRequest buildRequestForUpdate(String name, UpdateCachedContentConfig config requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -1737,9 +1721,9 @@ CachedContent processResponseForUpdate(ApiResponse response, UpdateCachedContent throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); - return JsonSerializable.fromJsonNode(responseNode, CachedContent.class); + return Common.fromJsonNode(responseNode, CachedContent.class); } /** @@ -1767,7 +1751,7 @@ BuiltRequest buildRequestForPrivateList(ListCachedContentsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -1796,7 +1780,7 @@ BuiltRequest buildRequestForPrivateList(ListCachedContentsConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -1810,7 +1794,7 @@ ListCachedContentsResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = listCachedContentsResponseFromVertex(responseNode, null); @@ -1821,7 +1805,7 @@ ListCachedContentsResponse processResponseForPrivateList( } ListCachedContentsResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ListCachedContentsResponse.class); + Common.fromJsonNode(responseNode, ListCachedContentsResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -1867,7 +1851,7 @@ public Pager list(ListCachedContentsConfig config) { return new Pager<>( Pager.PagedItem.CACHED_CONTENTS, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(config))); } } diff --git a/src/main/java/com/google/genai/Common.java b/src/main/java/com/google/genai/Common.java index df84ea9ae02..9d5df616742 100644 --- a/src/main/java/com/google/genai/Common.java +++ b/src/main/java/com/google/genai/Common.java @@ -16,27 +16,202 @@ package com.google.genai; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.StreamReadConstraints; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.api.core.InternalApi; import com.google.genai.errors.GenAiIOException; import com.google.genai.types.HttpOptions; +import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.StringJoiner; +import java.util.logging.Logger; import org.jspecify.annotations.Nullable; -/** Common utility methods for the GenAI SDK. */ +/** + * Common utility methods for the GenAI SDK. + * + *

All utility methods in this class are for internal use only and are subject to change without + * notice. + */ @InternalApi public final class Common { + @InternalApi public static final ObjectMapper objectMapper = new ObjectMapper(); + private static final Logger logger = Logger.getLogger(Common.class.getName()); + + /** + * System property to override the default max JSON string length (20MB) in read constraints. + * E.g., if you want to change the limit to 100MB, you can set it via + * `-Dgenai.json.maxReadLength=100000000`. + */ + public static final String MAX_READ_LENGTH_PROPERTY = "genai.json.maxReadLength"; + + /** Custom Jackson serializer for {@link Duration} to output "Xs" format. */ + static class CustomDurationSerializer extends JsonSerializer { + @Override + public void serialize( + Duration duration, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) + throws IOException { + if (duration == null) { + jsonGenerator.writeNull(); + } else { + jsonGenerator.writeString(duration.getSeconds() + "s"); + } + } + } + + /** Custom Jackson deserializer for {@link Duration} to parse "Xs" format. */ + static class CustomDurationDeserializer extends JsonDeserializer { + @Override + public Duration deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + String value = p.getValueAsString(); + + if (value == null || value.isEmpty()) { + return null; + } + if (value.endsWith("s")) { + String secondsPart = value.substring(0, value.length() - 1); + try { + long seconds = Long.parseLong(secondsPart); + return Duration.ofSeconds(seconds); + } catch (NumberFormatException e) { + throw ctxt.weirdStringException( + value, + Duration.class, + "Cannot parse duration from string: " + value + ". Expected format 'Xs'."); + } + } else { + throw ctxt.weirdStringException( + value, Duration.class, "Expected duration in format 'Xs', but got: " + value); + } + } + } + + /** Configures the stream read constraints for the JSON parser. */ + private static void configureStreamReadConstraints(int maxReadLength) { + if (maxReadLength <= 0) { + throw new IllegalArgumentException("Invalid JSON max read length: " + maxReadLength); + } + logger.info("Setting Jackson max read length to " + maxReadLength); + + StreamReadConstraints streamReadConstraints = + StreamReadConstraints.builder().maxStringLength(maxReadLength).build(); + + objectMapper.getFactory().setStreamReadConstraints(streamReadConstraints); + } + + static { + // Configure default stream read constraints. + int maxReadLength = 20000000; // 20MB + String maxReadLengthString = System.getProperty(MAX_READ_LENGTH_PROPERTY); + if (maxReadLengthString != null) { + try { + maxReadLength = Integer.parseInt(maxReadLengthString); + } catch (NumberFormatException e) { + logger.warning( + "Invalid JSON max read length in property " + + MAX_READ_LENGTH_PROPERTY + + ": " + + maxReadLengthString + + ". Using default value: " + + maxReadLength); + } + } + configureStreamReadConstraints(maxReadLength); + + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT); + objectMapper.registerModule(new Jdk8Module()); + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + SimpleModule durationModule = new SimpleModule(); + durationModule.addSerializer(Duration.class, new CustomDurationSerializer()); + durationModule.addDeserializer(Duration.class, new CustomDurationDeserializer()); + + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(durationModule); + } + + /** Sets the maximum allowed string length for Jackson JSON parsing. */ + public static void setMaxReadLength(int maxReadLength) { + configureStreamReadConstraints(maxReadLength); + } + + /** Returns the shared {@link ObjectMapper} instance used by the SDK. */ + public static ObjectMapper objectMapper() { + return objectMapper; + } + + /** Serializes the given object into a JSON string. */ + public static String toJsonString(Object object) { + try { + return objectMapper.writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new GenAiIOException("Failed to serialize the object to JSON.", e); + } + } + + /** Serializes the given object into a Jackson {@link JsonNode}. */ + public static JsonNode toJsonNode(Object object) { + return objectMapper.valueToTree(object); + } + + /** Deserializes the given JSON string into an instance of {@code clazz}. */ + public static T fromJsonString(String jsonString, Class clazz) { + try { + return objectMapper.readValue(jsonString, clazz); + } catch (JsonProcessingException e) { + throw new GenAiIOException("Failed to deserialize the JSON string.", e); + } + } + + /** Deserializes the given Jackson {@link JsonNode} into an instance of {@code clazz}. */ + public static T fromJsonNode(JsonNode jsonNode, Class clazz) { + try { + return objectMapper.treeToValue(jsonNode, clazz); + } catch (JsonProcessingException e) { + throw new GenAiIOException("Failed to deserialize the JSON node.", e); + } + } + + /** Parses the given JSON string into a Jackson {@link JsonNode}. */ + public static JsonNode stringToJsonNode(String string) { + try { + return objectMapper.readTree(string); + } catch (JsonProcessingException e) { + throw new GenAiIOException("Failed to parse the JSON string.", e); + } + } + private Common() {} /** A class that holds the path, body, and http options of an API request. */ @@ -136,8 +311,40 @@ public static void setValueByPath(ObjectNode jsonObject, String[] path, Object v ObjectNode sourceNode = (ObjectNode) value; currentObject.setAll(sourceNode); } else { - JsonNode valueNode = JsonSerializable.toJsonNode(value); - Transformers.updateJsonNode(currentObject, keyToSet, valueNode); + JsonNode valueNode = toJsonNode(value); + updateJsonNode(currentObject, keyToSet, valueNode); + } + } + + /** Updates an ObjectNode with a key and value, merging objects or avoiding empty overwrites. */ + public static void updateJsonNode(ObjectNode currentObject, String keyToSet, JsonNode valueNode) { + JsonNode existingData = currentObject.get(keyToSet); + + if (existingData != null) { + // Don't overwrite existing non-empty value with new empty value. + if (valueNode == null || valueNode.isNull() || valueNode.isEmpty()) { + return; + } + + // Don't fail when overwriting value with same value + if (valueNode.equals(existingData)) { + return; + } + + // Instead of overwriting dictionary with another dictionary, merge them. + if (existingData.isObject() && valueNode.isObject()) { + ((ObjectNode) existingData).setAll((ObjectNode) valueNode); + } else { + throw new IllegalArgumentException( + "Cannot set value for an existing key. Key: " + + keyToSet + + "; Existing value: " + + existingData + + "; New value: " + + valueNode); + } + } else { + currentObject.set(keyToSet, valueNode); } } @@ -221,6 +428,10 @@ public static void setValueByPath(ObjectNode jsonObject, String[] path, Object v return currentObject; } + /** + * Formats a template string by replacing {@code {key}} placeholders with values from {@code + * data}. + */ public static String formatMap(String template, JsonNode data) { if (data == null) { return template; @@ -238,6 +449,10 @@ public static String formatMap(String template, JsonNode data) { return template; } + /** + * Checks whether the given object represents a zero or default empty value (e.g., null, 0, false, + * '\0'). + */ public static boolean isZero(Object obj) { if (obj == null) { return true; @@ -333,7 +548,7 @@ public static void moveValueByPath(JsonNode data, Map paths) { String[] destKeys = destPath.split("\\."); // Determine keys to exclude from wildcard to avoid cyclic references - java.util.Set excludeKeys = new java.util.HashSet<>(); + Set excludeKeys = new HashSet<>(); int wildcardIdx = -1; for (int i = 0; i < sourceKeys.length; i++) { @@ -370,11 +585,7 @@ public static void moveValueByPath(JsonNode data, Map paths) { * @param excludeKeys Keys to exclude when processing wildcards */ public static void moveValueRecursive( - JsonNode data, - String[] sourceKeys, - String[] destKeys, - int keyIdx, - java.util.Set excludeKeys) { + JsonNode data, String[] sourceKeys, String[] destKeys, int keyIdx, Set excludeKeys) { if (keyIdx >= sourceKeys.length || data == null) { return; } @@ -398,7 +609,7 @@ public static void moveValueRecursive( ObjectNode objectNode = (ObjectNode) data; // Get all keys to move (excluding specified keys) - java.util.List keysToMove = new java.util.ArrayList<>(); + List keysToMove = new ArrayList<>(); Iterator fieldNames = objectNode.fieldNames(); while (fieldNames.hasNext()) { String fieldName = fieldNames.next(); @@ -408,7 +619,7 @@ public static void moveValueRecursive( } // Collect values to move - java.util.Map valuesToMove = new java.util.HashMap<>(); + Map valuesToMove = new HashMap<>(); for (String k : keysToMove) { valuesToMove.put(k, objectNode.get(k)); } @@ -419,7 +630,7 @@ public static void moveValueRecursive( JsonNode v = entry.getValue(); // Build destination keys with the field name - java.util.List newDestKeysList = new java.util.ArrayList<>(); + List newDestKeysList = new ArrayList<>(); for (int i = keyIdx; i < destKeys.length; i++) { String dk = destKeys[i]; if (dk.equals("*")) { diff --git a/src/main/java/com/google/genai/Documents.java b/src/main/java/com/google/genai/Documents.java index 609e52c460a..81a8f81645b 100644 --- a/src/main/java/com/google/genai/Documents.java +++ b/src/main/java/com/google/genai/Documents.java @@ -46,7 +46,7 @@ public Documents(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode deleteDocumentConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"force"}) != null) { Common.setValueByPath( @@ -60,7 +60,7 @@ ObjectNode deleteDocumentConfigToMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode deleteDocumentParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -71,8 +71,7 @@ ObjectNode deleteDocumentParametersToMldev(JsonNode fromObject, ObjectNode paren if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = deleteDocumentConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -81,7 +80,7 @@ ObjectNode deleteDocumentParametersToMldev(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode getDocumentParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -94,7 +93,7 @@ ObjectNode getDocumentParametersToMldev(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode listDocumentsConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -115,7 +114,7 @@ ObjectNode listDocumentsConfigToMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode listDocumentsParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parent"}) != null) { Common.setValueByPath( toObject, @@ -126,8 +125,7 @@ ObjectNode listDocumentsParametersToMldev(JsonNode fromObject, ObjectNode parent if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listDocumentsConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -136,7 +134,7 @@ ObjectNode listDocumentsParametersToMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode listDocumentsResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -172,7 +170,7 @@ BuiltRequest buildRequestForGet(String name, GetDocumentConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -202,7 +200,7 @@ BuiltRequest buildRequestForGet(String name, GetDocumentConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -215,7 +213,7 @@ Document processResponseForGet(ApiResponse response, GetDocumentConfig config) { throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -223,7 +221,7 @@ Document processResponseForGet(ApiResponse response, GetDocumentConfig config) { + " Agent Platform mode."); } - return JsonSerializable.fromJsonNode(responseNode, Document.class); + return Common.fromJsonNode(responseNode, Document.class); } public Document get(String name, GetDocumentConfig config) { @@ -247,7 +245,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteDocumentConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -277,7 +275,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteDocumentConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } public void delete(String name, DeleteDocumentConfig config) { @@ -301,7 +299,7 @@ BuiltRequest buildRequestForPrivateList(String parent, ListDocumentsConfig confi if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -331,7 +329,7 @@ BuiltRequest buildRequestForPrivateList(String parent, ListDocumentsConfig confi requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -345,7 +343,7 @@ ListDocumentsResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -357,7 +355,7 @@ ListDocumentsResponse processResponseForPrivateList( responseNode = listDocumentsResponseFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, ListDocumentsResponse.class); + return Common.fromJsonNode(responseNode, ListDocumentsResponse.class); } ListDocumentsResponse privateList(String parent, ListDocumentsConfig config) { @@ -395,7 +393,7 @@ public Pager list(String parent, ListDocumentsConfig config) { return new Pager<>( Pager.PagedItem.DOCUMENTS, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(parent, config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(parent, config))); } } diff --git a/src/main/java/com/google/genai/FileSearchStores.java b/src/main/java/com/google/genai/FileSearchStores.java index 96d9964e387..93188638ea7 100644 --- a/src/main/java/com/google/genai/FileSearchStores.java +++ b/src/main/java/com/google/genai/FileSearchStores.java @@ -69,7 +69,7 @@ public FileSearchStores(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode createFileSearchStoreConfigToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -92,13 +92,12 @@ ObjectNode createFileSearchStoreConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createFileSearchStoreParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createFileSearchStoreConfigToMldev( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -107,7 +106,7 @@ ObjectNode createFileSearchStoreParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteFileSearchStoreConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"force"}) != null) { Common.setValueByPath( @@ -121,7 +120,7 @@ ObjectNode deleteFileSearchStoreConfigToMldev(JsonNode fromObject, ObjectNode pa @ExcludeFromGeneratedCoverageReport ObjectNode deleteFileSearchStoreParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -132,8 +131,7 @@ ObjectNode deleteFileSearchStoreParametersToMldev(JsonNode fromObject, ObjectNod if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = deleteFileSearchStoreConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -142,7 +140,7 @@ ObjectNode deleteFileSearchStoreParametersToMldev(JsonNode fromObject, ObjectNod @ExcludeFromGeneratedCoverageReport ObjectNode getFileSearchStoreParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -155,7 +153,7 @@ ObjectNode getFileSearchStoreParametersToMldev(JsonNode fromObject, ObjectNode p @ExcludeFromGeneratedCoverageReport ObjectNode importFileConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"customMetadata"}) != null) { Common.setValueByPath( @@ -176,7 +174,7 @@ ObjectNode importFileConfigToMldev(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -210,8 +208,7 @@ ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode parentOb toObject, new String[] {"response"}, importFileResponseFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -220,7 +217,7 @@ ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode parentOb @ExcludeFromGeneratedCoverageReport ObjectNode importFileParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"fileSearchStoreName"}) != null) { Common.setValueByPath( toObject, @@ -238,8 +235,7 @@ ObjectNode importFileParametersToMldev(JsonNode fromObject, ObjectNode parentObj if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = importFileConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -248,7 +244,7 @@ ObjectNode importFileParametersToMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode importFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -275,7 +271,7 @@ ObjectNode importFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode listFileSearchStoresConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -296,12 +292,11 @@ ObjectNode listFileSearchStoresConfigToMldev(JsonNode fromObject, ObjectNode par @ExcludeFromGeneratedCoverageReport ObjectNode listFileSearchStoresParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listFileSearchStoresConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -310,7 +305,7 @@ ObjectNode listFileSearchStoresParametersToMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode listFileSearchStoresResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -337,7 +332,7 @@ ObjectNode listFileSearchStoresResponseFromMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode uploadToFileSearchStoreConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) { Common.setValueByPath( @@ -373,7 +368,7 @@ ObjectNode uploadToFileSearchStoreConfigToMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport ObjectNode uploadToFileSearchStoreParametersToMldev( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"fileSearchStoreName"}) != null) { Common.setValueByPath( toObject, @@ -384,8 +379,7 @@ ObjectNode uploadToFileSearchStoreParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = uploadToFileSearchStoreConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -395,7 +389,7 @@ ObjectNode uploadToFileSearchStoreParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode uploadToFileSearchStoreResumableResponseFromMldev( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -415,7 +409,7 @@ BuiltRequest buildRequestForCreate(CreateFileSearchStoreConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -445,7 +439,7 @@ BuiltRequest buildRequestForCreate(CreateFileSearchStoreConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -459,7 +453,7 @@ FileSearchStore processResponseForCreate( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -467,7 +461,7 @@ FileSearchStore processResponseForCreate( + " Agent Platform mode."); } - return JsonSerializable.fromJsonNode(responseNode, FileSearchStore.class); + return Common.fromJsonNode(responseNode, FileSearchStore.class); } public FileSearchStore create(CreateFileSearchStoreConfig config) { @@ -491,7 +485,7 @@ BuiltRequest buildRequestForGet(String name, GetFileSearchStoreConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -521,7 +515,7 @@ BuiltRequest buildRequestForGet(String name, GetFileSearchStoreConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -534,7 +528,7 @@ FileSearchStore processResponseForGet(ApiResponse response, GetFileSearchStoreCo throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -542,7 +536,7 @@ FileSearchStore processResponseForGet(ApiResponse response, GetFileSearchStoreCo + " Agent Platform mode."); } - return JsonSerializable.fromJsonNode(responseNode, FileSearchStore.class); + return Common.fromJsonNode(responseNode, FileSearchStore.class); } public FileSearchStore get(String name, GetFileSearchStoreConfig config) { @@ -567,7 +561,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteFileSearchStoreConfig conf if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -597,7 +591,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteFileSearchStoreConfig conf requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } public void delete(String name, DeleteFileSearchStoreConfig config) { @@ -619,7 +613,7 @@ BuiltRequest buildRequestForPrivateList(ListFileSearchStoresConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -649,7 +643,7 @@ BuiltRequest buildRequestForPrivateList(ListFileSearchStoresConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -663,7 +657,7 @@ ListFileSearchStoresResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -675,7 +669,7 @@ ListFileSearchStoresResponse processResponseForPrivateList( responseNode = listFileSearchStoresResponseFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, ListFileSearchStoresResponse.class); + return Common.fromJsonNode(responseNode, ListFileSearchStoresResponse.class); } ListFileSearchStoresResponse privateList(ListFileSearchStoresConfig config) { @@ -701,7 +695,7 @@ BuiltRequest buildRequestForPrivateUploadToFileSearchStore( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -733,7 +727,7 @@ BuiltRequest buildRequestForPrivateUploadToFileSearchStore( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -763,7 +757,7 @@ UploadToFileSearchStoreResumableResponse processResponseForPrivateUploadToFileSe .build(); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -775,8 +769,7 @@ UploadToFileSearchStoreResumableResponse processResponseForPrivateUploadToFileSe responseNode = uploadToFileSearchStoreResumableResponseFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode( - responseNode, UploadToFileSearchStoreResumableResponse.class); + return Common.fromJsonNode(responseNode, UploadToFileSearchStoreResumableResponse.class); } UploadToFileSearchStoreResumableResponse privateUploadToFileSearchStore( @@ -806,7 +799,7 @@ BuiltRequest buildRequestForImportFile( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -836,7 +829,7 @@ BuiltRequest buildRequestForImportFile( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -849,7 +842,7 @@ ImportFileOperation processResponseForImportFile(ApiResponse response, ImportFil throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -861,7 +854,7 @@ ImportFileOperation processResponseForImportFile(ApiResponse response, ImportFil responseNode = importFileOperationFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, ImportFileOperation.class); + return Common.fromJsonNode(responseNode, ImportFileOperation.class); } public ImportFileOperation importFile( @@ -899,8 +892,8 @@ public Pager list(ListFileSearchStoresConfig config) { return new Pager<>( Pager.PagedItem.FILE_SEARCH_STORES, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(config))); } static UploadToFileSearchStoreOperation operationFromResponse(ResponseBody responseBody) { diff --git a/src/main/java/com/google/genai/Files.java b/src/main/java/com/google/genai/Files.java index 0898891e419..0d9b281fe27 100644 --- a/src/main/java/com/google/genai/Files.java +++ b/src/main/java/com/google/genai/Files.java @@ -78,7 +78,7 @@ public Files(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode createFileParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"file"}) != null) { Common.setValueByPath( toObject, @@ -91,7 +91,7 @@ ObjectNode createFileParametersToMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode createFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -104,7 +104,7 @@ ObjectNode createFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode deleteFileParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -117,7 +117,7 @@ ObjectNode deleteFileParametersToMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode deleteFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -130,7 +130,7 @@ ObjectNode deleteFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode getFileParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -143,7 +143,7 @@ ObjectNode getFileParametersToMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode internalRegisterFilesParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uris"}) != null) { Common.setValueByPath( toObject, @@ -156,7 +156,7 @@ ObjectNode internalRegisterFilesParametersToMldev(JsonNode fromObject, ObjectNod @ExcludeFromGeneratedCoverageReport ObjectNode listFilesConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -177,12 +177,11 @@ ObjectNode listFilesConfigToMldev(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode listFilesParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listFilesConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject); } @@ -191,7 +190,7 @@ ObjectNode listFilesParametersToMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode listFilesResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -218,7 +217,7 @@ ObjectNode listFilesResponseFromMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode registerFilesResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -244,7 +243,7 @@ BuiltRequest buildRequestForPrivateList(ListFilesConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -274,7 +273,7 @@ BuiltRequest buildRequestForPrivateList(ListFilesConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -287,7 +286,7 @@ ListFilesResponse processResponseForPrivateList(ApiResponse response, ListFilesC throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -299,8 +298,7 @@ ListFilesResponse processResponseForPrivateList(ApiResponse response, ListFilesC responseNode = listFilesResponseFromMldev(responseNode, null); } - ListFilesResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ListFilesResponse.class); + ListFilesResponse sdkResponse = Common.fromJsonNode(responseNode, ListFilesResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -333,7 +331,7 @@ BuiltRequest buildRequestForPrivateCreate(File file, CreateFileConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -363,7 +361,7 @@ BuiltRequest buildRequestForPrivateCreate(File file, CreateFileConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -393,7 +391,7 @@ CreateFileResponse processResponseForPrivateCreate( .build(); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -405,7 +403,7 @@ CreateFileResponse processResponseForPrivateCreate( responseNode = createFileResponseFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, CreateFileResponse.class); + return Common.fromJsonNode(responseNode, CreateFileResponse.class); } CreateFileResponse privateCreate(File file, CreateFileConfig config) { @@ -429,7 +427,7 @@ BuiltRequest buildRequestForGet(String name, GetFileConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -459,7 +457,7 @@ BuiltRequest buildRequestForGet(String name, GetFileConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -472,7 +470,7 @@ File processResponseForGet(ApiResponse response, GetFileConfig config) { throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -480,7 +478,7 @@ File processResponseForGet(ApiResponse response, GetFileConfig config) { + " Agent Platform mode."); } - return JsonSerializable.fromJsonNode(responseNode, File.class); + return Common.fromJsonNode(responseNode, File.class); } /** @@ -511,7 +509,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteFileConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -541,7 +539,7 @@ BuiltRequest buildRequestForDelete(String name, DeleteFileConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -554,7 +552,7 @@ DeleteFileResponse processResponseForDelete(ApiResponse response, DeleteFileConf throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -566,8 +564,7 @@ DeleteFileResponse processResponseForDelete(ApiResponse response, DeleteFileConf responseNode = deleteFileResponseFromMldev(responseNode, null); } - DeleteFileResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, DeleteFileResponse.class); + DeleteFileResponse sdkResponse = Common.fromJsonNode(responseNode, DeleteFileResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -608,7 +605,7 @@ BuiltRequest buildRequestForPrivateRegisterFiles(List uris, RegisterFile if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -638,7 +635,7 @@ BuiltRequest buildRequestForPrivateRegisterFiles(List uris, RegisterFile requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -668,7 +665,7 @@ RegisterFilesResponse processResponseForPrivateRegisterFiles( .build(); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -680,7 +677,7 @@ RegisterFilesResponse processResponseForPrivateRegisterFiles( responseNode = registerFilesResponseFromMldev(responseNode, null); } - return JsonSerializable.fromJsonNode(responseNode, RegisterFilesResponse.class); + return Common.fromJsonNode(responseNode, RegisterFilesResponse.class); } RegisterFilesResponse privateRegisterFiles(List uris, RegisterFilesConfig config) { @@ -717,8 +714,8 @@ public Pager list(ListFilesConfig config) { return new Pager<>( Pager.PagedItem.FILES, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(config))); } /** diff --git a/src/main/java/com/google/genai/JsonSerializable.java b/src/main/java/com/google/genai/JsonSerializable.java index 52d1db05f4e..2662c5eb013 100644 --- a/src/main/java/com/google/genai/JsonSerializable.java +++ b/src/main/java/com/google/genai/JsonSerializable.java @@ -16,30 +16,15 @@ package com.google.genai; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadConstraints; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.api.core.InternalApi; -import com.google.genai.errors.GenAiIOException; import java.util.logging.Logger; /** A class that can be serialized to JSON and deserialized from JSON. */ public abstract class JsonSerializable { - @InternalApi protected static final ObjectMapper objectMapper = new ObjectMapper(); + @InternalApi protected static final ObjectMapper objectMapper = Common.objectMapper; private static final Logger logger = Logger.getLogger(JsonSerializable.class.getName()); /** @@ -47,142 +32,44 @@ public abstract class JsonSerializable { * E.g., if you want to change the limit to 100MB, you can set it via * `-Dgenai.json.maxReadLength=100000000`. */ - public static final String MAX_READ_LENGTH_PROPERTY = "genai.json.maxReadLength"; + public static final String MAX_READ_LENGTH_PROPERTY = Common.MAX_READ_LENGTH_PROPERTY; /** Custom Jackson serializer for {@link java.time.Duration} to output "Xs" format. */ - static class CustomDurationSerializer extends JsonSerializer { - @Override - public void serialize( - java.time.Duration duration, - JsonGenerator jsonGenerator, - SerializerProvider serializerProvider) - throws java.io.IOException { - if (duration == null) { - jsonGenerator.writeNull(); - } else { - jsonGenerator.writeString(duration.getSeconds() + "s"); - } - } - } + static class CustomDurationSerializer extends Common.CustomDurationSerializer {} /** Custom Jackson deserializer for {@link java.time.Duration} to parse "Xs" format. */ - static class CustomDurationDeserializer extends JsonDeserializer { - @Override - public java.time.Duration deserialize(JsonParser p, DeserializationContext ctxt) - throws java.io.IOException, JsonProcessingException { - String value = p.getValueAsString(); - - if (value == null || value.isEmpty()) { - return null; - } - if (value.endsWith("s")) { - String secondsPart = value.substring(0, value.length() - 1); - try { - long seconds = Long.parseLong(secondsPart); - return java.time.Duration.ofSeconds(seconds); - } catch (NumberFormatException e) { - throw ctxt.weirdStringException( - value, - java.time.Duration.class, - "Cannot parse duration from string: " + value + ". Expected format 'Xs'."); - } - } else { - // If it doesn't end with 's', delegate to the default deserializer. - throw ctxt.weirdStringException( - value, java.time.Duration.class, "Expected duration in format 'Xs', but got: " + value); - } - } - } - - /** Configures the stream read constraints for the JSON parser. */ - private static void configureStreamReadConstraints(int maxReadLength) { - if (maxReadLength <= 0) { - throw new IllegalArgumentException("Invalid JSON max read length: " + maxReadLength); - } - logger.info("Overriding default JSON max string length. New value = " + maxReadLength); - StreamReadConstraints constraints = - StreamReadConstraints.builder().maxStringLength(maxReadLength).build(); - objectMapper.getFactory().setStreamReadConstraints(constraints); - } - - static { - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT); - objectMapper.registerModule(new Jdk8Module()); - // Disable writing dates as timestamps to use ISO-8601 string format for Instant - objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - - // Create a module for custom serializers/deserializers - SimpleModule customModule = new SimpleModule(); - customModule.addSerializer(java.time.Duration.class, new CustomDurationSerializer()); - customModule.addDeserializer(java.time.Duration.class, new CustomDurationDeserializer()); - - // Register JavaTimeModule for other java.time types *before* the custom module - // This ensures our custom Duration handling takes precedence over the default one - // provided by JavaTimeModule. - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.registerModule(customModule); - - try { - String propertyValue = System.getProperty(MAX_READ_LENGTH_PROPERTY); - if (propertyValue != null && !propertyValue.isEmpty()) { - int maxStringLength = Integer.parseInt(propertyValue); - configureStreamReadConstraints(maxStringLength); - } - } catch (NumberFormatException e) { - logger.warning( - "Failed to parse system property [" - + MAX_READ_LENGTH_PROPERTY - + "]. Using default 20MB limit."); - } - } + static class CustomDurationDeserializer extends Common.CustomDurationDeserializer {} /** Serializes the instance to a Json string. */ public String toJson() { - return toJsonString(this); + return Common.toJsonString(this); } /** Serializes an object to a Json string. */ public static String toJsonString(Object object) { - try { - return objectMapper.writeValueAsString(object); - } catch (JsonProcessingException e) { - throw new GenAiIOException("Failed to serialize the object to JSON.", e); - } + return Common.toJsonString(object); } /** Serializes an object to a JsonNode. */ public static JsonNode toJsonNode(Object object) { - return objectMapper.valueToTree(object); + return Common.toJsonNode(object); } /** Deserializes a Json string to an object of the given type. This is for internal use only. */ @InternalApi public static T fromJsonString(String jsonString, Class clazz) { - try { - return objectMapper.readValue(jsonString, clazz); - } catch (JsonProcessingException e) { - throw new GenAiIOException("Failed to deserialize the JSON string.", e); - } + return Common.fromJsonString(jsonString, clazz); } /** Deserializes a JsonNode to an object of the given type. */ @InternalApi public static T fromJsonNode(JsonNode jsonNode, Class clazz) { - try { - return objectMapper.treeToValue(jsonNode, clazz); - } catch (JsonProcessingException e) { - throw new GenAiIOException("Failed to deserialize the JSON node.", e); - } + return Common.fromJsonNode(jsonNode, clazz); } /** Converts a Json string to a JsonNode. */ public static JsonNode stringToJsonNode(String string) { - try { - return objectMapper.readTree(string); - } catch (JsonProcessingException e) { - throw new GenAiIOException("Failed to parse the JSON string.", e); - } + return Common.stringToJsonNode(string); } /** @@ -194,10 +81,10 @@ public static JsonNode stringToJsonNode(String string) { * @param maxReadLength the new maximum string length in bytes (e.g., 100_000_000 for 100MB). */ public static void setMaxReadLength(int maxReadLength) { - configureStreamReadConstraints(maxReadLength); + Common.setMaxReadLength(maxReadLength); } public static ObjectMapper objectMapper() { - return objectMapper; + return Common.objectMapper(); } } diff --git a/src/main/java/com/google/genai/LiveConverters.java b/src/main/java/com/google/genai/LiveConverters.java index 6cb6d8f647e..c12db44589a 100644 --- a/src/main/java/com/google/genai/LiveConverters.java +++ b/src/main/java/com/google/genai/LiveConverters.java @@ -33,7 +33,7 @@ public LiveConverters(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"apiKey"}) != null) { Common.setValueByPath( toObject, @@ -83,7 +83,7 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) { Common.setValueByPath( toObject, @@ -109,7 +109,7 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode codeExecutionResultToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outcome"}) != null) { Common.setValueByPath( toObject, @@ -135,7 +135,7 @@ ObjectNode codeExecutionResultToVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode computerUseToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"environment"}) != null) { Common.setValueByPath( toObject, @@ -170,14 +170,14 @@ ObjectNode computerUseToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -194,14 +194,14 @@ ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -218,7 +218,7 @@ ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode executableCodeToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"code"}) != null) { Common.setValueByPath( toObject, @@ -244,7 +244,7 @@ ObjectNode executableCodeToVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) { throw new IllegalArgumentException( "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -270,7 +270,7 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) { Common.setValueByPath( toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"})); @@ -307,7 +307,7 @@ ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode generationConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"modelSelectionConfig"}) != null) { Common.setValueByPath( toObject, @@ -425,8 +425,7 @@ ObjectNode generationConfigToVertex(JsonNode fromObject, ObjectNode parentObject toObject, new String[] {"speechConfig"}, speechConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"speechConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"speechConfig"})), toObject)); } @@ -497,14 +496,13 @@ ObjectNode generationConfigToVertex(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"authConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"authConfig"}, authConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"authConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"authConfig"})), toObject)); } @@ -526,7 +524,7 @@ ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"searchTypes"}) != null) { Common.setValueByPath( toObject, @@ -558,14 +556,14 @@ ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode liveClientContentToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"turns"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"turns"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(contentToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"turns"}, result); } @@ -582,14 +580,14 @@ ObjectNode liveClientContentToMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode liveClientContentToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"turns"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"turns"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(contentToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"turns"}, result); } @@ -606,14 +604,13 @@ ObjectNode liveClientContentToVertex(JsonNode fromObject, ObjectNode parentObjec @ExcludeFromGeneratedCoverageReport ObjectNode liveClientMessageToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"setup"}) != null) { Common.setValueByPath( toObject, new String[] {"setup"}, liveClientSetupToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"setup"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"setup"})), toObject)); } @@ -622,8 +619,7 @@ ObjectNode liveClientMessageToMldev(JsonNode fromObject, ObjectNode parentObject toObject, new String[] {"clientContent"}, liveClientContentToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"clientContent"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"clientContent"})), toObject)); } @@ -632,8 +628,7 @@ ObjectNode liveClientMessageToMldev(JsonNode fromObject, ObjectNode parentObject toObject, new String[] {"realtimeInput"}, liveClientRealtimeInputToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"realtimeInput"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"realtimeInput"})), toObject)); } @@ -642,7 +637,7 @@ ObjectNode liveClientMessageToMldev(JsonNode fromObject, ObjectNode parentObject toObject, new String[] {"realtime_input"}, liveSendRealtimeInputParametersToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"realtimeInputParameters"})), toObject)); } @@ -659,14 +654,13 @@ ObjectNode liveClientMessageToMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode liveClientMessageToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"setup"}) != null) { Common.setValueByPath( toObject, new String[] {"setup"}, liveClientSetupToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"setup"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"setup"})), toObject)); } @@ -675,8 +669,7 @@ ObjectNode liveClientMessageToVertex(JsonNode fromObject, ObjectNode parentObjec toObject, new String[] {"clientContent"}, liveClientContentToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"clientContent"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"clientContent"})), toObject)); } @@ -685,8 +678,7 @@ ObjectNode liveClientMessageToVertex(JsonNode fromObject, ObjectNode parentObjec toObject, new String[] {"realtimeInput"}, liveClientRealtimeInputToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"realtimeInput"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"realtimeInput"})), toObject)); } @@ -695,7 +687,7 @@ ObjectNode liveClientMessageToVertex(JsonNode fromObject, ObjectNode parentObjec toObject, new String[] {"realtime_input"}, liveSendRealtimeInputParametersToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"realtimeInputParameters"})), toObject)); } @@ -712,7 +704,7 @@ ObjectNode liveClientMessageToVertex(JsonNode fromObject, ObjectNode parentObjec @ExcludeFromGeneratedCoverageReport ObjectNode liveClientRealtimeInputToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaChunks"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"mediaChunks"}); @@ -720,7 +712,7 @@ ObjectNode liveClientRealtimeInputToMldev(JsonNode fromObject, ObjectNode parent ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(blobToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(blobToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"mediaChunks"}, result); } @@ -730,8 +722,7 @@ ObjectNode liveClientRealtimeInputToMldev(JsonNode fromObject, ObjectNode parent toObject, new String[] {"audio"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"audio"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"audio"})), toObject)); } @@ -747,8 +738,7 @@ ObjectNode liveClientRealtimeInputToMldev(JsonNode fromObject, ObjectNode parent toObject, new String[] {"video"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject)); } @@ -778,7 +768,7 @@ ObjectNode liveClientRealtimeInputToMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode liveClientRealtimeInputToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaChunks"}) != null) { Common.setValueByPath( toObject, @@ -832,7 +822,7 @@ ObjectNode liveClientRealtimeInputToVertex(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -852,7 +842,7 @@ ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) toObject, new String[] {"systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -866,7 +856,7 @@ ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToMldev(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToMldev(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(toObject, new String[] {"tools"}, result); } @@ -883,7 +873,7 @@ ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) toObject, new String[] {"sessionResumption"}, sessionResumptionConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"sessionResumption"})), toObject)); } @@ -936,7 +926,7 @@ ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(safetySettingToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(safetySettingToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"safetySettings"}, result); } @@ -953,7 +943,7 @@ ObjectNode liveClientSetupToMldev(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode liveClientSetupToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -966,7 +956,7 @@ ObjectNode liveClientSetupToVertex(JsonNode fromObject, ObjectNode parentObject) toObject, new String[] {"generationConfig"}, generationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"generationConfig"})), toObject)); } @@ -976,7 +966,7 @@ ObjectNode liveClientSetupToVertex(JsonNode fromObject, ObjectNode parentObject) toObject, new String[] {"systemInstruction"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -990,7 +980,7 @@ ObjectNode liveClientSetupToVertex(JsonNode fromObject, ObjectNode parentObject) ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToVertex(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToVertex(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(toObject, new String[] {"tools"}, result); } @@ -1070,7 +1060,7 @@ ObjectNode liveClientSetupToVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"responseModalities"}) != null) { Common.setValueByPath( @@ -1148,7 +1138,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject parentObject, new String[] {"setup", "systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -1162,7 +1152,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToMldev(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToMldev(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(parentObject, new String[] {"setup", "tools"}, result); } @@ -1172,7 +1162,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject parentObject, new String[] {"setup", "sessionResumption"}, sessionResumptionConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"sessionResumption"})), toObject)); } @@ -1232,7 +1222,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(safetySettingToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(safetySettingToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"setup", "safetySettings"}, result); } @@ -1249,7 +1239,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"responseModalities"}) != null) { Common.setValueByPath( @@ -1305,7 +1295,7 @@ ObjectNode liveConnectConfigToVertex(JsonNode fromObject, ObjectNode parentObjec parentObject, new String[] {"setup", "generationConfig", "speechConfig"}, speechConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tLiveSpeechConfig( Common.getValueByPath(fromObject, new String[] {"speechConfig"}))), toObject)); @@ -1330,7 +1320,7 @@ ObjectNode liveConnectConfigToVertex(JsonNode fromObject, ObjectNode parentObjec parentObject, new String[] {"setup", "systemInstruction"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -1344,7 +1334,7 @@ ObjectNode liveConnectConfigToVertex(JsonNode fromObject, ObjectNode parentObjec ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToVertex(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToVertex(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(parentObject, new String[] {"setup", "tools"}, result); } @@ -1424,7 +1414,7 @@ ObjectNode liveConnectConfigToVertex(JsonNode fromObject, ObjectNode parentObjec @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -1438,8 +1428,7 @@ ObjectNode liveConnectParametersToMldev( toObject, new String[] {"config"}, liveConnectConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject)); } @@ -1449,7 +1438,7 @@ ObjectNode liveConnectParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -1463,8 +1452,7 @@ ObjectNode liveConnectParametersToVertex( toObject, new String[] {"config"}, liveConnectConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject)); } @@ -1473,7 +1461,7 @@ ObjectNode liveConnectParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode liveSendRealtimeInputParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"media"}) != null) { ArrayNode keyArray = (ArrayNode) @@ -1482,7 +1470,7 @@ ObjectNode liveSendRealtimeInputParametersToMldev(JsonNode fromObject, ObjectNod ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(blobToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(blobToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"mediaChunks"}, result); } @@ -1492,7 +1480,7 @@ ObjectNode liveSendRealtimeInputParametersToMldev(JsonNode fromObject, ObjectNod toObject, new String[] {"audio"}, blobToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tAudioBlob( Common.getValueByPath(fromObject, new String[] {"audio"}))), toObject)); @@ -1510,7 +1498,7 @@ ObjectNode liveSendRealtimeInputParametersToMldev(JsonNode fromObject, ObjectNod toObject, new String[] {"video"}, blobToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tImageBlob( Common.getValueByPath(fromObject, new String[] {"video"}))), toObject)); @@ -1542,7 +1530,7 @@ ObjectNode liveSendRealtimeInputParametersToMldev(JsonNode fromObject, ObjectNod @ExcludeFromGeneratedCoverageReport ObjectNode liveSendRealtimeInputParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"media"}) != null) { Common.setValueByPath( toObject, @@ -1597,7 +1585,7 @@ ObjectNode liveSendRealtimeInputParametersToVertex(JsonNode fromObject, ObjectNo @ExcludeFromGeneratedCoverageReport ObjectNode liveServerMessageFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"setupComplete"}) != null) { Common.setValueByPath( toObject, @@ -1659,8 +1647,7 @@ ObjectNode liveServerMessageFromMldev(JsonNode fromObject, ObjectNode parentObje toObject, new String[] {"voiceActivity"}, voiceActivityFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceActivity"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceActivity"})), toObject)); } @@ -1669,7 +1656,7 @@ ObjectNode liveServerMessageFromMldev(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode liveServerMessageFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"setupComplete"}) != null) { Common.setValueByPath( toObject, @@ -1703,8 +1690,7 @@ ObjectNode liveServerMessageFromVertex(JsonNode fromObject, ObjectNode parentObj toObject, new String[] {"usageMetadata"}, usageMetadataFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"usageMetadata"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"usageMetadata"})), toObject)); } @@ -1734,8 +1720,7 @@ ObjectNode liveServerMessageFromVertex(JsonNode fromObject, ObjectNode parentObj toObject, new String[] {"voiceActivity"}, voiceActivityFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceActivity"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceActivity"})), toObject)); } @@ -1744,7 +1729,7 @@ ObjectNode liveServerMessageFromVertex(JsonNode fromObject, ObjectNode parentObj @ExcludeFromGeneratedCoverageReport ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"name"}))) { throw new IllegalArgumentException( "name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise" @@ -1763,7 +1748,7 @@ ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode multiSpeakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}); @@ -1771,7 +1756,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode paren ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(speakerVoiceConfigToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(speakerVoiceConfigToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"speakerVoiceConfigs"}, result); } @@ -1781,7 +1766,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -1808,8 +1793,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"fileData"}, fileDataToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"fileData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"fileData"})), toObject)); } @@ -1818,8 +1802,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCall"}, functionCallToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"functionCall"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"functionCall"})), toObject)); } @@ -1835,8 +1818,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"inlineData"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inlineData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inlineData"})), toObject)); } @@ -1901,7 +1883,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -1914,7 +1896,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"codeExecutionResult"}, codeExecutionResultToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"})), toObject)); } @@ -1924,8 +1906,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"executableCode"}, executableCodeToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"executableCode"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"executableCode"})), toObject)); } @@ -2015,7 +1996,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode replicatedVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) { Common.setValueByPath( toObject, @@ -2047,7 +2028,7 @@ ObjectNode replicatedVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentO @ExcludeFromGeneratedCoverageReport ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"category"}) != null) { Common.setValueByPath( toObject, @@ -2073,7 +2054,7 @@ ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode sessionResumptionConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"handle"}) != null) { Common.setValueByPath( toObject, @@ -2092,7 +2073,7 @@ ObjectNode sessionResumptionConfigToMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode speakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speaker"}) != null) { Common.setValueByPath( toObject, @@ -2105,8 +2086,7 @@ ObjectNode speakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentObje toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject)); } @@ -2115,14 +2095,13 @@ ObjectNode speakerVoiceConfigToVertex(JsonNode fromObject, ObjectNode parentObje @ExcludeFromGeneratedCoverageReport ObjectNode speechConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"voiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject)); } @@ -2138,7 +2117,7 @@ ObjectNode speechConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"multiSpeakerVoiceConfig"}, multiSpeakerVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"multiSpeakerVoiceConfig"})), toObject)); } @@ -2148,7 +2127,7 @@ ObjectNode speechConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"retrieval"}))) { throw new IllegalArgumentException( "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -2174,8 +2153,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleSearch"}, googleSearchToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleSearch"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleSearch"})), toObject)); } @@ -2184,8 +2162,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleMaps"}, googleMapsToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleMaps"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleMaps"})), toObject)); } @@ -2247,7 +2224,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrieval"}) != null) { Common.setValueByPath( toObject, @@ -2260,8 +2237,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"computerUse"}, computerUseToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"computerUse"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"computerUse"})), toObject)); } @@ -2334,7 +2310,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(mcpServerToVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(mcpServerToVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"mcpServers"}, result); } @@ -2351,7 +2327,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode usageMetadataFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"promptTokenCount"}) != null) { Common.setValueByPath( toObject, @@ -2434,7 +2410,7 @@ ObjectNode usageMetadataFromVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode voiceActivityFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"type"}) != null) { Common.setValueByPath( toObject, @@ -2454,7 +2430,7 @@ ObjectNode voiceActivityFromMldev(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode voiceActivityFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"type"}) != null) { Common.setValueByPath( toObject, @@ -2474,13 +2450,13 @@ ObjectNode voiceActivityFromVertex(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode voiceConfigToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"replicatedVoiceConfig"}, replicatedVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"})), toObject)); } diff --git a/src/main/java/com/google/genai/Models.java b/src/main/java/com/google/genai/Models.java index 91607a9ba85..7386585646a 100644 --- a/src/main/java/com/google/genai/Models.java +++ b/src/main/java/com/google/genai/Models.java @@ -147,7 +147,7 @@ void videoGenerationReferenceTypeMldevEnumValidate(Object enumValue) { @ExcludeFromGeneratedCoverageReport ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"apiKey"}) != null) { Common.setValueByPath( toObject, @@ -197,7 +197,7 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonN @ExcludeFromGeneratedCoverageReport ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) { Common.setValueByPath( toObject, @@ -223,7 +223,7 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro @ExcludeFromGeneratedCoverageReport ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"content"}) != null) { Common.setValueByPath( toObject, @@ -236,7 +236,7 @@ ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject, Json toObject, new String[] {"citationMetadata"}, citationMetadataFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"citationMetadata"})), toObject, rootObject)); @@ -304,7 +304,7 @@ ObjectNode candidateFromMldev(JsonNode fromObject, ObjectNode parentObject, Json @ExcludeFromGeneratedCoverageReport ObjectNode citationMetadataFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"citationSources"}) != null) { Common.setValueByPath( toObject, @@ -318,7 +318,7 @@ ObjectNode citationMetadataFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode codeExecutionResultToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outcome"}) != null) { Common.setValueByPath( toObject, @@ -345,7 +345,7 @@ ObjectNode codeExecutionResultToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode computeTokensParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -362,7 +362,7 @@ ObjectNode computeTokensParametersToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"contents"}, result); } @@ -373,7 +373,7 @@ ObjectNode computeTokensParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode computeTokensResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -394,7 +394,7 @@ ObjectNode computeTokensResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode computerUseToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"environment"}) != null) { Common.setValueByPath( toObject, @@ -430,7 +430,7 @@ ObjectNode computerUseToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode contentEmbeddingFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"values"}) != null) { Common.setValueByPath( toObject, @@ -443,8 +443,7 @@ ObjectNode contentEmbeddingFromVertex( toObject, new String[] {"statistics"}, contentEmbeddingStatisticsFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"statistics"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"statistics"})), toObject, rootObject)); } @@ -455,7 +454,7 @@ ObjectNode contentEmbeddingFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode contentEmbeddingStatisticsFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"truncated"}) != null) { Common.setValueByPath( toObject, @@ -482,14 +481,14 @@ ObjectNode contentEmbeddingStatisticsFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(partToMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -506,14 +505,14 @@ ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(partToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -531,7 +530,7 @@ ObjectNode contentToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod @ExcludeFromGeneratedCoverageReport ObjectNode controlReferenceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"controlType"}) != null) { Common.setValueByPath( toObject, @@ -552,7 +551,7 @@ ObjectNode controlReferenceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))) { throw new IllegalArgumentException( @@ -578,14 +577,14 @@ ObjectNode countTokensConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"systemInstruction"}) != null) { Common.setValueByPath( parentObject, new String[] {"systemInstruction"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject, @@ -598,7 +597,7 @@ ObjectNode countTokensConfigToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(toolToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -608,7 +607,7 @@ ObjectNode countTokensConfigToVertex( parentObject, new String[] {"generationConfig"}, generationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"generationConfig"})), toObject, rootObject)); @@ -620,7 +619,7 @@ ObjectNode countTokensConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -637,7 +636,7 @@ ObjectNode countTokensParametersToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentToMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"contents"}, result); } @@ -645,8 +644,7 @@ ObjectNode countTokensParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = countTokensConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -657,7 +655,7 @@ ObjectNode countTokensParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -674,7 +672,7 @@ ObjectNode countTokensParametersToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"contents"}, result); } @@ -682,8 +680,7 @@ ObjectNode countTokensParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = countTokensConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -694,7 +691,7 @@ ObjectNode countTokensParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -722,7 +719,7 @@ ObjectNode countTokensResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode countTokensResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -743,7 +740,7 @@ ObjectNode countTokensResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode deleteModelParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -758,7 +755,7 @@ ObjectNode deleteModelParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteModelParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -773,7 +770,7 @@ ObjectNode deleteModelParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode deleteModelResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -787,7 +784,7 @@ ObjectNode deleteModelResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode deleteModelResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -801,7 +798,7 @@ ObjectNode deleteModelResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode editImageConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outputGcsUri"}) != null) { Common.setValueByPath( @@ -928,7 +925,7 @@ ObjectNode editImageConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode editImageParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -951,8 +948,7 @@ ObjectNode editImageParametersToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - referenceImageAPIToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(referenceImageAPIToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"instances[0]", "referenceImages"}, result); } @@ -960,8 +956,7 @@ ObjectNode editImageParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = editImageConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -972,7 +967,7 @@ ObjectNode editImageParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode editImageResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -987,8 +982,7 @@ ObjectNode editImageResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedImages"}, result); } @@ -999,7 +993,7 @@ ObjectNode editImageResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"taskType"}) != null) { Common.setValueByPath( parentObject, @@ -1051,7 +1045,7 @@ ObjectNode embedContentConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); JsonNode discriminatorTaskType = (JsonNode) Common.getValueByPath(rootObject, new String[] {"embeddingApiType"}); @@ -1182,7 +1176,7 @@ ObjectNode embedContentConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentParametersPrivateToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -1202,7 +1196,7 @@ ObjectNode embedContentParametersPrivateToMldev( if (Common.getValueByPath(fromObject, new String[] {"content"}) != null) { JsonNode unused = contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"content"}))), toObject, @@ -1212,8 +1206,7 @@ ObjectNode embedContentParametersPrivateToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = embedContentConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -1230,7 +1223,7 @@ ObjectNode embedContentParametersPrivateToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentParametersPrivateToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -1263,7 +1256,7 @@ ObjectNode embedContentParametersPrivateToVertex( toObject, new String[] {"content"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"content"}))), toObject, @@ -1274,8 +1267,7 @@ ObjectNode embedContentParametersPrivateToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = embedContentConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -1286,7 +1278,7 @@ ObjectNode embedContentParametersPrivateToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1314,7 +1306,7 @@ ObjectNode embedContentResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode embedContentResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1330,8 +1322,7 @@ ObjectNode embedContentResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - contentEmbeddingFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentEmbeddingFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"embeddings"}, result); } @@ -1375,7 +1366,7 @@ ObjectNode embedContentResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode endpointFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"endpoint"}) != null) { Common.setValueByPath( toObject, @@ -1396,7 +1387,7 @@ ObjectNode endpointFromVertex(JsonNode fromObject, ObjectNode parentObject, Json @ExcludeFromGeneratedCoverageReport ObjectNode executableCodeToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"code"}) != null) { Common.setValueByPath( toObject, @@ -1422,7 +1413,7 @@ ObjectNode executableCodeToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) { throw new IllegalArgumentException( "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -1449,7 +1440,7 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNod @ExcludeFromGeneratedCoverageReport ObjectNode functionCallToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) { Common.setValueByPath( toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"})); @@ -1487,7 +1478,7 @@ ObjectNode functionCallToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode functionCallingConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"allowedFunctionNames"}) != null) { Common.setValueByPath( toObject, @@ -1515,14 +1506,14 @@ ObjectNode functionCallingConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentConfigToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"systemInstruction"}) != null) { Common.setValueByPath( parentObject, new String[] {"systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject, @@ -1646,7 +1637,7 @@ ObjectNode generateContentConfigToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(safetySettingToMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(safetySettingToMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"safetySettings"}, result); } @@ -1659,9 +1650,7 @@ ObjectNode generateContentConfigToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - toolToMldev( - JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject, rootObject)); + result.add(toolToMldev(Common.toJsonNode(Transformers.tTool(item)), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -1671,8 +1660,7 @@ ObjectNode generateContentConfigToMldev( parentObject, new String[] {"toolConfig"}, toolConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"toolConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"toolConfig"})), toObject, rootObject)); } @@ -1731,8 +1719,7 @@ ObjectNode generateContentConfigToMldev( toObject, new String[] {"imageConfig"}, imageConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"imageConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"imageConfig"})), toObject, rootObject)); } @@ -1770,14 +1757,14 @@ ObjectNode generateContentConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentConfigToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"systemInstruction"}) != null) { Common.setValueByPath( parentObject, new String[] {"systemInstruction"}, contentToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject, @@ -1911,9 +1898,7 @@ ObjectNode generateContentConfigToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - toolToVertex( - JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject, rootObject)); + result.add(toolToVertex(Common.toJsonNode(Transformers.tTool(item)), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"tools"}, result); } @@ -1923,8 +1908,7 @@ ObjectNode generateContentConfigToVertex( parentObject, new String[] {"toolConfig"}, toolConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"toolConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"toolConfig"})), toObject, rootObject)); } @@ -1963,7 +1947,7 @@ ObjectNode generateContentConfigToVertex( toObject, new String[] {"speechConfig"}, speechConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tSpeechConfig( Common.getValueByPath(fromObject, new String[] {"speechConfig"}))), toObject, @@ -1989,8 +1973,7 @@ ObjectNode generateContentConfigToVertex( toObject, new String[] {"imageConfig"}, imageConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"imageConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"imageConfig"})), toObject, rootObject)); } @@ -2029,7 +2012,7 @@ ObjectNode generateContentConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -2046,7 +2029,7 @@ ObjectNode generateContentParametersToMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentToMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"contents"}, result); } @@ -2057,8 +2040,7 @@ ObjectNode generateContentParametersToMldev( new String[] {"generationConfig"}, generateContentConfigToMldev( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject)); } @@ -2069,7 +2051,7 @@ ObjectNode generateContentParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -2086,7 +2068,7 @@ ObjectNode generateContentParametersToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(contentToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(contentToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"contents"}, result); } @@ -2097,8 +2079,7 @@ ObjectNode generateContentParametersToVertex( new String[] {"generationConfig"}, generateContentConfigToVertex( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject)); } @@ -2109,7 +2090,7 @@ ObjectNode generateContentParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -2124,7 +2105,7 @@ ObjectNode generateContentResponseFromMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(candidateFromMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(candidateFromMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"candidates"}, result); } @@ -2170,7 +2151,7 @@ ObjectNode generateContentResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateContentResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -2226,7 +2207,7 @@ ObjectNode generateContentResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"outputGcsUri"}))) { throw new IllegalArgumentException( @@ -2351,7 +2332,7 @@ ObjectNode generateImagesConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outputGcsUri"}) != null) { Common.setValueByPath( @@ -2478,7 +2459,7 @@ ObjectNode generateImagesConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -2497,8 +2478,7 @@ ObjectNode generateImagesParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = generateImagesConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -2509,7 +2489,7 @@ ObjectNode generateImagesParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -2528,8 +2508,7 @@ ObjectNode generateImagesParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = generateImagesConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -2540,7 +2519,7 @@ ObjectNode generateImagesParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -2555,8 +2534,7 @@ ObjectNode generateImagesResponseFromMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageFromMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageFromMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedImages"}, result); } @@ -2567,7 +2545,7 @@ ObjectNode generateImagesResponseFromMldev( toObject, new String[] {"positivePromptSafetyAttributes"}, safetyAttributesFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"positivePromptSafetyAttributes"})), toObject, @@ -2580,7 +2558,7 @@ ObjectNode generateImagesResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateImagesResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -2595,8 +2573,7 @@ ObjectNode generateImagesResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedImages"}, result); } @@ -2607,7 +2584,7 @@ ObjectNode generateImagesResponseFromVertex( toObject, new String[] {"positivePromptSafetyAttributes"}, safetyAttributesFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"positivePromptSafetyAttributes"})), toObject, @@ -2620,7 +2597,7 @@ ObjectNode generateImagesResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"numberOfVideos"}) != null) { Common.setValueByPath( @@ -2706,8 +2683,7 @@ ObjectNode generateVideosConfigToMldev( parentObject, new String[] {"instances[0]", "lastFrame"}, imageToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"lastFrame"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"lastFrame"})), toObject, rootObject)); } @@ -2720,8 +2696,7 @@ ObjectNode generateVideosConfigToMldev( for (JsonNode item : keyArray) { result.add( - videoGenerationReferenceImageToMldev( - JsonSerializable.toJsonNode(item), toObject, rootObject)); + videoGenerationReferenceImageToMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"instances[0]", "referenceImages"}, result); } @@ -2763,7 +2738,7 @@ ObjectNode generateVideosConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"numberOfVideos"}) != null) { Common.setValueByPath( @@ -2854,8 +2829,7 @@ ObjectNode generateVideosConfigToVertex( parentObject, new String[] {"instances[0]", "lastFrame"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"lastFrame"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"lastFrame"})), toObject, rootObject)); } @@ -2868,8 +2842,7 @@ ObjectNode generateVideosConfigToVertex( for (JsonNode item : keyArray) { result.add( - videoGenerationReferenceImageToVertex( - JsonSerializable.toJsonNode(item), toObject, rootObject)); + videoGenerationReferenceImageToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"instances[0]", "referenceImages"}, result); } @@ -2879,7 +2852,7 @@ ObjectNode generateVideosConfigToVertex( parentObject, new String[] {"instances[0]", "mask"}, videoGenerationMaskToVertex( - JsonSerializable.toJsonNode(Common.getValueByPath(fromObject, new String[] {"mask"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"mask"})), toObject, rootObject)); } @@ -2917,7 +2890,7 @@ ObjectNode generateVideosConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosOperationFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -2952,7 +2925,7 @@ ObjectNode generateVideosOperationFromMldev( toObject, new String[] {"response"}, generateVideosResponseFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"response", "generateVideoResponse"})), toObject, @@ -2965,7 +2938,7 @@ ObjectNode generateVideosOperationFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosOperationFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -2999,8 +2972,7 @@ ObjectNode generateVideosOperationFromVertex( toObject, new String[] {"response"}, generateVideosResponseFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject, rootObject)); } @@ -3011,7 +2983,7 @@ ObjectNode generateVideosOperationFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -3032,8 +3004,7 @@ ObjectNode generateVideosParametersToMldev( toObject, new String[] {"instances[0]", "image"}, imageToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -3043,8 +3014,7 @@ ObjectNode generateVideosParametersToMldev( toObject, new String[] {"instances[0]", "video"}, videoToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject, rootObject)); } @@ -3052,8 +3022,7 @@ ObjectNode generateVideosParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"source"}) != null) { JsonNode unused = generateVideosSourceToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"source"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"source"})), toObject, rootObject); } @@ -3061,8 +3030,7 @@ ObjectNode generateVideosParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = generateVideosConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -3073,7 +3041,7 @@ ObjectNode generateVideosParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -3094,8 +3062,7 @@ ObjectNode generateVideosParametersToVertex( toObject, new String[] {"instances[0]", "image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -3105,8 +3072,7 @@ ObjectNode generateVideosParametersToVertex( toObject, new String[] {"instances[0]", "video"}, videoToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject, rootObject)); } @@ -3114,8 +3080,7 @@ ObjectNode generateVideosParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"source"}) != null) { JsonNode unused = generateVideosSourceToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"source"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"source"})), toObject, rootObject); } @@ -3123,8 +3088,7 @@ ObjectNode generateVideosParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = generateVideosConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -3135,7 +3099,7 @@ ObjectNode generateVideosParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"generatedSamples"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"generatedSamples"}); @@ -3143,8 +3107,7 @@ ObjectNode generateVideosResponseFromMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedVideoFromMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedVideoFromMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -3169,15 +3132,14 @@ ObjectNode generateVideosResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"videos"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"videos"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedVideoFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedVideoFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -3202,7 +3164,7 @@ ObjectNode generateVideosResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosSourceToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"prompt"}) != null) { Common.setValueByPath( parentObject, @@ -3215,8 +3177,7 @@ ObjectNode generateVideosSourceToMldev( parentObject, new String[] {"instances[0]", "image"}, imageToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -3226,8 +3187,7 @@ ObjectNode generateVideosSourceToMldev( parentObject, new String[] {"instances[0]", "video"}, videoToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject, rootObject)); } @@ -3238,7 +3198,7 @@ ObjectNode generateVideosSourceToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosSourceToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"prompt"}) != null) { Common.setValueByPath( parentObject, @@ -3251,8 +3211,7 @@ ObjectNode generateVideosSourceToVertex( parentObject, new String[] {"instances[0]", "image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -3262,8 +3221,7 @@ ObjectNode generateVideosSourceToVertex( parentObject, new String[] {"instances[0]", "video"}, videoToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject, rootObject)); } @@ -3274,14 +3232,13 @@ ObjectNode generateVideosSourceToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generatedImageFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3298,8 +3255,7 @@ ObjectNode generatedImageFromMldev( toObject, new String[] {"safetyAttributes"}, safetyAttributesFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3310,14 +3266,13 @@ ObjectNode generatedImageFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generatedImageFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3334,8 +3289,7 @@ ObjectNode generatedImageFromVertex( toObject, new String[] {"safetyAttributes"}, safetyAttributesFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3353,14 +3307,13 @@ ObjectNode generatedImageFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generatedImageMaskFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"mask"}, imageFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3378,14 +3331,13 @@ ObjectNode generatedImageMaskFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generatedVideoFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"video"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject, rootObject)); } @@ -3396,14 +3348,13 @@ ObjectNode generatedVideoFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode generatedVideoFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -3414,7 +3365,7 @@ ObjectNode generatedVideoFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generationConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"modelSelectionConfig"}) != null) { Common.setValueByPath( toObject, @@ -3532,8 +3483,7 @@ ObjectNode generationConfigToVertex( toObject, new String[] {"speechConfig"}, speechConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"speechConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"speechConfig"})), toObject, rootObject)); } @@ -3606,7 +3556,7 @@ ObjectNode generationConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode getModelParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -3621,7 +3571,7 @@ ObjectNode getModelParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode getModelParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -3635,14 +3585,13 @@ ObjectNode getModelParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"authConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"authConfig"}, authConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"authConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"authConfig"})), toObject, rootObject)); } @@ -3666,7 +3615,7 @@ ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject, JsonN @ExcludeFromGeneratedCoverageReport ObjectNode googleSearchToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"searchTypes"}) != null) { Common.setValueByPath( toObject, @@ -3698,7 +3647,7 @@ ObjectNode googleSearchToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode imageConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"aspectRatio"}) != null) { Common.setValueByPath( toObject, @@ -3750,7 +3699,7 @@ ObjectNode imageConfigToMldev(JsonNode fromObject, ObjectNode parentObject, Json @ExcludeFromGeneratedCoverageReport ObjectNode imageConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"aspectRatio"}) != null) { Common.setValueByPath( toObject, @@ -3805,7 +3754,7 @@ ObjectNode imageConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode imageFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"bytesBase64Encoded"}) != null) { Common.setValueByPath( @@ -3827,7 +3776,7 @@ ObjectNode imageFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode imageFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, @@ -3855,7 +3804,7 @@ ObjectNode imageFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod @ExcludeFromGeneratedCoverageReport ObjectNode imageToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"gcsUri"}))) { throw new IllegalArgumentException( "gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -3881,7 +3830,7 @@ ObjectNode imageToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode r @ExcludeFromGeneratedCoverageReport ObjectNode imageToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, @@ -3909,7 +3858,7 @@ ObjectNode imageToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode listModelsConfigToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -3946,7 +3895,7 @@ ObjectNode listModelsConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode listModelsConfigToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -3983,13 +3932,12 @@ ObjectNode listModelsConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode listModelsParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listModelsConfigToMldev( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -4000,13 +3948,12 @@ ObjectNode listModelsParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode listModelsParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listModelsConfigToVertex( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -4017,7 +3964,7 @@ ObjectNode listModelsParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode listModelsResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -4041,7 +3988,7 @@ ObjectNode listModelsResponseFromMldev( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(modelFromMldev(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(modelFromMldev(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"models"}, result); } @@ -4052,7 +3999,7 @@ ObjectNode listModelsResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode listModelsResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -4076,7 +4023,7 @@ ObjectNode listModelsResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(modelFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(modelFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"models"}, result); } @@ -4087,7 +4034,7 @@ ObjectNode listModelsResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode maskReferenceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"maskMode"}) != null) { Common.setValueByPath( toObject, @@ -4114,7 +4061,7 @@ ObjectNode maskReferenceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"name"}))) { throw new IllegalArgumentException( "name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise" @@ -4133,7 +4080,7 @@ ObjectNode mcpServerToVertex(JsonNode fromObject, ObjectNode parentObject, JsonN @ExcludeFromGeneratedCoverageReport ObjectNode modelFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -4230,7 +4177,7 @@ ObjectNode modelFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode modelFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -4266,7 +4213,7 @@ ObjectNode modelFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(endpointFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(endpointFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"endpoints"}, result); } @@ -4283,8 +4230,7 @@ ObjectNode modelFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod toObject, new String[] {"tunedModelInfo"}, tunedModelInfoFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -4309,7 +4255,7 @@ ObjectNode modelFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod @ExcludeFromGeneratedCoverageReport ObjectNode multiSpeakerVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}); @@ -4317,8 +4263,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - speakerVoiceConfigToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(speakerVoiceConfigToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"speakerVoiceConfigs"}, result); } @@ -4328,7 +4273,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -4355,8 +4300,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro toObject, new String[] {"fileData"}, fileDataToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"fileData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"fileData"})), toObject, rootObject)); } @@ -4366,8 +4310,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro toObject, new String[] {"functionCall"}, functionCallToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"functionCall"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"functionCall"})), toObject, rootObject)); } @@ -4384,8 +4327,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro toObject, new String[] {"inlineData"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inlineData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inlineData"})), toObject, rootObject)); } @@ -4451,7 +4393,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro @ExcludeFromGeneratedCoverageReport ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -4464,7 +4406,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r toObject, new String[] {"codeExecutionResult"}, codeExecutionResultToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"})), toObject, rootObject)); @@ -4475,8 +4417,7 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r toObject, new String[] {"executableCode"}, executableCodeToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"executableCode"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"executableCode"})), toObject, rootObject)); } @@ -4568,14 +4509,13 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r @ExcludeFromGeneratedCoverageReport ObjectNode productImageToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"productImage"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"productImage"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"productImage"})), toObject, rootObject)); } @@ -4586,7 +4526,7 @@ ObjectNode productImageToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode recontextImageConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"numberOfImages"}) != null) { Common.setValueByPath( @@ -4671,7 +4611,7 @@ ObjectNode recontextImageConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode recontextImageParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -4683,8 +4623,7 @@ ObjectNode recontextImageParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"source"}) != null) { JsonNode unused = recontextImageSourceToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"source"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"source"})), toObject, rootObject); } @@ -4692,8 +4631,7 @@ ObjectNode recontextImageParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = recontextImageConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -4704,7 +4642,7 @@ ObjectNode recontextImageParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode recontextImageResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"predictions"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"predictions"}); @@ -4712,8 +4650,7 @@ ObjectNode recontextImageResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedImages"}, result); } @@ -4724,7 +4661,7 @@ ObjectNode recontextImageResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode recontextImageSourceToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"prompt"}) != null) { Common.setValueByPath( parentObject, @@ -4737,8 +4674,7 @@ ObjectNode recontextImageSourceToVertex( parentObject, new String[] {"instances[0]", "personImage", "image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"personImage"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"personImage"})), toObject, rootObject)); } @@ -4750,7 +4686,7 @@ ObjectNode recontextImageSourceToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(productImageToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(productImageToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(parentObject, new String[] {"instances[0]", "productImages"}, result); } @@ -4761,14 +4697,13 @@ ObjectNode recontextImageSourceToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode referenceImageAPIToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"referenceImage"}) != null) { Common.setValueByPath( toObject, new String[] {"referenceImage"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"referenceImage"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"referenceImage"})), toObject, rootObject)); } @@ -4792,7 +4727,7 @@ ObjectNode referenceImageAPIToVertex( toObject, new String[] {"maskImageConfig"}, maskReferenceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"maskImageConfig"})), toObject, rootObject)); @@ -4803,7 +4738,7 @@ ObjectNode referenceImageAPIToVertex( toObject, new String[] {"controlImageConfig"}, controlReferenceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"controlImageConfig"})), toObject, rootObject)); @@ -4829,7 +4764,7 @@ ObjectNode referenceImageAPIToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode replicatedVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) { Common.setValueByPath( toObject, @@ -4862,7 +4797,7 @@ ObjectNode replicatedVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode safetyAttributesFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"safetyAttributes", "categories"}) != null) { Common.setValueByPath( @@ -4891,7 +4826,7 @@ ObjectNode safetyAttributesFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode safetyAttributesFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"safetyAttributes", "categories"}) != null) { Common.setValueByPath( @@ -4920,7 +4855,7 @@ ObjectNode safetyAttributesFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode safetySettingToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"category"}) != null) { Common.setValueByPath( toObject, @@ -4947,14 +4882,13 @@ ObjectNode safetySettingToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode scribbleImageToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"image"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -4965,7 +4899,7 @@ ObjectNode scribbleImageToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode segmentImageConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mode"}) != null) { Common.setValueByPath( @@ -5015,7 +4949,7 @@ ObjectNode segmentImageConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode segmentImageParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -5027,8 +4961,7 @@ ObjectNode segmentImageParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"source"}) != null) { JsonNode unused = segmentImageSourceToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"source"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"source"})), toObject, rootObject); } @@ -5036,8 +4969,7 @@ ObjectNode segmentImageParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = segmentImageConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -5048,7 +4980,7 @@ ObjectNode segmentImageParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode segmentImageResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"predictions"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"predictions"}); @@ -5056,8 +4988,7 @@ ObjectNode segmentImageResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageMaskFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageMaskFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedMasks"}, result); } @@ -5068,7 +4999,7 @@ ObjectNode segmentImageResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode segmentImageSourceToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"prompt"}) != null) { Common.setValueByPath( parentObject, @@ -5081,8 +5012,7 @@ ObjectNode segmentImageSourceToVertex( parentObject, new String[] {"instances[0]", "image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -5092,8 +5022,7 @@ ObjectNode segmentImageSourceToVertex( parentObject, new String[] {"instances[0]", "scribble"}, scribbleImageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"scribbleImage"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"scribbleImage"})), toObject, rootObject)); } @@ -5104,7 +5033,7 @@ ObjectNode segmentImageSourceToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode speakerVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speaker"}) != null) { Common.setValueByPath( toObject, @@ -5117,8 +5046,7 @@ ObjectNode speakerVoiceConfigToVertex( toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject, rootObject)); } @@ -5129,14 +5057,13 @@ ObjectNode speakerVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode speechConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"voiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject, rootObject)); } @@ -5153,7 +5080,7 @@ ObjectNode speechConfigToVertex( toObject, new String[] {"multiSpeakerVoiceConfig"}, multiSpeakerVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"multiSpeakerVoiceConfig"})), toObject, rootObject)); @@ -5164,7 +5091,7 @@ ObjectNode speechConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrievalConfig"}) != null) { Common.setValueByPath( toObject, @@ -5177,7 +5104,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonN toObject, new String[] {"functionCallingConfig"}, functionCallingConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"functionCallingConfig"})), toObject, rootObject)); @@ -5196,7 +5123,7 @@ ObjectNode toolConfigToMldev(JsonNode fromObject, ObjectNode parentObject, JsonN @ExcludeFromGeneratedCoverageReport ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrievalConfig"}) != null) { Common.setValueByPath( toObject, @@ -5223,7 +5150,7 @@ ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject, Json @ExcludeFromGeneratedCoverageReport ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"retrieval"}))) { throw new IllegalArgumentException( "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -5249,8 +5176,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro toObject, new String[] {"googleSearch"}, googleSearchToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleSearch"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleSearch"})), toObject, rootObject)); } @@ -5260,8 +5186,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro toObject, new String[] {"googleMaps"}, googleMapsToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleMaps"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleMaps"})), toObject, rootObject)); } @@ -5324,7 +5249,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro @ExcludeFromGeneratedCoverageReport ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"retrieval"}) != null) { Common.setValueByPath( toObject, @@ -5337,8 +5262,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r toObject, new String[] {"computerUse"}, computerUseToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"computerUse"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"computerUse"})), toObject, rootObject)); } @@ -5412,7 +5336,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(mcpServerToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(mcpServerToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"mcpServers"}, result); } @@ -5430,7 +5354,7 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode r @ExcludeFromGeneratedCoverageReport ObjectNode tunedModelInfoFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath( fromObject, new String[] {"labels", "google-vertex-llm-tuning-base-model-id"}) != null) { @@ -5461,7 +5385,7 @@ ObjectNode tunedModelInfoFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode updateModelConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -5490,7 +5414,7 @@ ObjectNode updateModelConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode updateModelConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"displayName"}) != null) { Common.setValueByPath( @@ -5519,7 +5443,7 @@ ObjectNode updateModelConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode updateModelParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -5531,8 +5455,7 @@ ObjectNode updateModelParametersToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = updateModelConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -5543,7 +5466,7 @@ ObjectNode updateModelParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode updateModelParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -5555,8 +5478,7 @@ ObjectNode updateModelParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = updateModelConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -5567,7 +5489,7 @@ ObjectNode updateModelParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode upscaleImageAPIConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"outputGcsUri"}) != null) { Common.setValueByPath( @@ -5652,7 +5574,7 @@ ObjectNode upscaleImageAPIConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode upscaleImageAPIParametersToVertex( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -5666,8 +5588,7 @@ ObjectNode upscaleImageAPIParametersToVertex( toObject, new String[] {"instances[0]", "image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -5682,8 +5603,7 @@ ObjectNode upscaleImageAPIParametersToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = upscaleImageAPIConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -5694,7 +5614,7 @@ ObjectNode upscaleImageAPIParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode upscaleImageResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -5709,8 +5629,7 @@ ObjectNode upscaleImageResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - generatedImageFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(generatedImageFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"generatedImages"}, result); } @@ -5720,7 +5639,7 @@ ObjectNode upscaleImageResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uri"}) != null) { Common.setValueByPath( toObject, new String[] {"uri"}, Common.getValueByPath(fromObject, new String[] {"uri"})); @@ -5745,7 +5664,7 @@ ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode videoFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, @@ -5774,14 +5693,13 @@ ObjectNode videoFromVertex(JsonNode fromObject, ObjectNode parentObject, JsonNod @ExcludeFromGeneratedCoverageReport ObjectNode videoGenerationMaskToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"image"}) != null) { Common.setValueByPath( toObject, new String[] {"_self"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -5799,14 +5717,13 @@ ObjectNode videoGenerationMaskToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode videoGenerationReferenceImageToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"image"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -5826,14 +5743,13 @@ ObjectNode videoGenerationReferenceImageToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode videoGenerationReferenceImageToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"image"}) != null) { Common.setValueByPath( toObject, new String[] {"image"}, imageToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"image"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"image"})), toObject, rootObject)); } @@ -5850,7 +5766,7 @@ ObjectNode videoGenerationReferenceImageToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode videoToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uri"}) != null) { Common.setValueByPath( toObject, new String[] {"uri"}, Common.getValueByPath(fromObject, new String[] {"uri"})); @@ -5875,7 +5791,7 @@ ObjectNode videoToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode r @ExcludeFromGeneratedCoverageReport ObjectNode videoToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uri"}) != null) { Common.setValueByPath( toObject, @@ -5903,13 +5819,13 @@ ObjectNode videoToVertex(JsonNode fromObject, ObjectNode parentObject, JsonNode @ExcludeFromGeneratedCoverageReport ObjectNode voiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"replicatedVoiceConfig"}, replicatedVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"})), toObject, rootObject)); @@ -5940,7 +5856,7 @@ BuiltRequest buildRequestForPrivateGenerateContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -5969,7 +5885,7 @@ BuiltRequest buildRequestForPrivateGenerateContent( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -5999,7 +5915,7 @@ GenerateContentResponse processResponseForPrivateGenerateContent( .build(); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = generateContentResponseFromVertex(responseNode, null, parameterNode); @@ -6010,7 +5926,7 @@ GenerateContentResponse processResponseForPrivateGenerateContent( } GenerateContentResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, GenerateContentResponse.class); + Common.fromJsonNode(responseNode, GenerateContentResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6035,7 +5951,7 @@ GenerateContentResponse privateGenerateContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateGenerateContent(model, contents, config); try (ApiResponse response = @@ -6060,7 +5976,7 @@ BuiltRequest buildRequestForPrivateGenerateContentStream( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6089,7 +6005,7 @@ BuiltRequest buildRequestForPrivateGenerateContentStream( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6119,7 +6035,7 @@ ResponseStream privateGenerateContentStream( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateGenerateContentStream(model, contents, config); @@ -6155,7 +6071,7 @@ BuiltRequest buildRequestForPrivateEmbedContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6192,7 +6108,7 @@ BuiltRequest buildRequestForPrivateEmbedContent( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6206,7 +6122,7 @@ EmbedContentResponse processResponseForPrivateEmbedContent( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = embedContentResponseFromVertex(responseNode, null, parameterNode); @@ -6217,7 +6133,7 @@ EmbedContentResponse processResponseForPrivateEmbedContent( } EmbedContentResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, EmbedContentResponse.class); + Common.fromJsonNode(responseNode, EmbedContentResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6253,7 +6169,7 @@ EmbedContentResponse privateEmbedContent( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateEmbedContent(model, contents, content, embeddingApiType, config); @@ -6279,7 +6195,7 @@ BuiltRequest buildRequestForPrivateGenerateImages( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6308,7 +6224,7 @@ BuiltRequest buildRequestForPrivateGenerateImages( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6322,7 +6238,7 @@ GenerateImagesResponse processResponseForPrivateGenerateImages( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = generateImagesResponseFromVertex(responseNode, null, parameterNode); @@ -6333,7 +6249,7 @@ GenerateImagesResponse processResponseForPrivateGenerateImages( } GenerateImagesResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, GenerateImagesResponse.class); + Common.fromJsonNode(responseNode, GenerateImagesResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6359,7 +6275,7 @@ GenerateImagesResponse privateGenerateImages( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateGenerateImages(model, prompt, config); try (ApiResponse response = @@ -6390,7 +6306,7 @@ BuiltRequest buildRequestForPrivateEditImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6416,7 +6332,7 @@ BuiltRequest buildRequestForPrivateEditImage( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6430,7 +6346,7 @@ EditImageResponse processResponseForPrivateEditImage( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = editImageResponseFromVertex(responseNode, null, parameterNode); @@ -6442,8 +6358,7 @@ EditImageResponse processResponseForPrivateEditImage( + " Developer API mode."); } - EditImageResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, EditImageResponse.class); + EditImageResponse sdkResponse = Common.fromJsonNode(responseNode, EditImageResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6475,7 +6390,7 @@ EditImageResponse privateEditImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateEditImage(model, prompt, referenceImages, config); @@ -6504,7 +6419,7 @@ BuiltRequest buildRequestForPrivateUpscaleImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6530,7 +6445,7 @@ BuiltRequest buildRequestForPrivateUpscaleImage( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6544,7 +6459,7 @@ UpscaleImageResponse processResponseForPrivateUpscaleImage( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = upscaleImageResponseFromVertex(responseNode, null, parameterNode); @@ -6557,7 +6472,7 @@ UpscaleImageResponse processResponseForPrivateUpscaleImage( } UpscaleImageResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, UpscaleImageResponse.class); + Common.fromJsonNode(responseNode, UpscaleImageResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6586,7 +6501,7 @@ UpscaleImageResponse privateUpscaleImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateUpscaleImage(model, image, upscaleFactor, config); @@ -6612,7 +6527,7 @@ BuiltRequest buildRequestForRecontextImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6638,7 +6553,7 @@ BuiltRequest buildRequestForRecontextImage( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6652,7 +6567,7 @@ RecontextImageResponse processResponseForRecontextImage( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = recontextImageResponseFromVertex(responseNode, null, parameterNode); @@ -6664,7 +6579,7 @@ RecontextImageResponse processResponseForRecontextImage( + " Developer API mode."); } - return JsonSerializable.fromJsonNode(responseNode, RecontextImageResponse.class); + return Common.fromJsonNode(responseNode, RecontextImageResponse.class); } /** @@ -6696,7 +6611,7 @@ public RecontextImageResponse recontextImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForRecontextImage(model, source, config); try (ApiResponse response = @@ -6721,7 +6636,7 @@ BuiltRequest buildRequestForSegmentImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6747,7 +6662,7 @@ BuiltRequest buildRequestForSegmentImage( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6761,7 +6676,7 @@ SegmentImageResponse processResponseForSegmentImage( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = segmentImageResponseFromVertex(responseNode, null, parameterNode); @@ -6773,7 +6688,7 @@ SegmentImageResponse processResponseForSegmentImage( + " Developer API mode."); } - return JsonSerializable.fromJsonNode(responseNode, SegmentImageResponse.class); + return Common.fromJsonNode(responseNode, SegmentImageResponse.class); } /** @@ -6802,7 +6717,7 @@ public SegmentImageResponse segmentImage( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForSegmentImage(model, source, config); try (ApiResponse response = @@ -6823,7 +6738,7 @@ BuiltRequest buildRequestForGet(String model, GetModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6852,7 +6767,7 @@ BuiltRequest buildRequestForGet(String model, GetModelConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6865,7 +6780,7 @@ Model processResponseForGet(ApiResponse response, GetModelConfig config, JsonNod throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = modelFromVertex(responseNode, null, parameterNode); @@ -6875,7 +6790,7 @@ Model processResponseForGet(ApiResponse response, GetModelConfig config, JsonNod responseNode = modelFromMldev(responseNode, null, parameterNode); } - return JsonSerializable.fromJsonNode(responseNode, Model.class); + return Common.fromJsonNode(responseNode, Model.class); } /** @@ -6892,7 +6807,7 @@ public Model get(String model, GetModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForGet(model, config); try (ApiResponse response = @@ -6910,7 +6825,7 @@ BuiltRequest buildRequestForPrivateList(ListModelsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -6939,7 +6854,7 @@ BuiltRequest buildRequestForPrivateList(ListModelsConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -6953,7 +6868,7 @@ ListModelsResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = listModelsResponseFromVertex(responseNode, null, parameterNode); @@ -6963,8 +6878,7 @@ ListModelsResponse processResponseForPrivateList( responseNode = listModelsResponseFromMldev(responseNode, null, parameterNode); } - ListModelsResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ListModelsResponse.class); + ListModelsResponse sdkResponse = Common.fromJsonNode(responseNode, ListModelsResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -6982,7 +6896,7 @@ ListModelsResponse privateList(ListModelsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateList(config); try (ApiResponse response = @@ -7003,7 +6917,7 @@ BuiltRequest buildRequestForUpdate(String model, UpdateModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -7032,7 +6946,7 @@ BuiltRequest buildRequestForUpdate(String model, UpdateModelConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -7046,7 +6960,7 @@ Model processResponseForUpdate( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = modelFromVertex(responseNode, null, parameterNode); @@ -7056,7 +6970,7 @@ Model processResponseForUpdate( responseNode = modelFromMldev(responseNode, null, parameterNode); } - return JsonSerializable.fromJsonNode(responseNode, Model.class); + return Common.fromJsonNode(responseNode, Model.class); } /** @@ -7079,7 +6993,7 @@ public Model update(String model, UpdateModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForUpdate(model, config); try (ApiResponse response = @@ -7100,7 +7014,7 @@ BuiltRequest buildRequestForDelete(String model, DeleteModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -7129,7 +7043,7 @@ BuiltRequest buildRequestForDelete(String model, DeleteModelConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -7143,7 +7057,7 @@ DeleteModelResponse processResponseForDelete( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = deleteModelResponseFromVertex(responseNode, null, parameterNode); @@ -7153,8 +7067,7 @@ DeleteModelResponse processResponseForDelete( responseNode = deleteModelResponseFromMldev(responseNode, null, parameterNode); } - DeleteModelResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, DeleteModelResponse.class); + DeleteModelResponse sdkResponse = Common.fromJsonNode(responseNode, DeleteModelResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -7180,7 +7093,7 @@ public DeleteModelResponse delete(String model, DeleteModelConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForDelete(model, config); try (ApiResponse response = @@ -7205,7 +7118,7 @@ BuiltRequest buildRequestForCountTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -7234,7 +7147,7 @@ BuiltRequest buildRequestForCountTokens( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -7248,7 +7161,7 @@ CountTokensResponse processResponseForCountTokens( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = countTokensResponseFromVertex(responseNode, null, parameterNode); @@ -7258,8 +7171,7 @@ CountTokensResponse processResponseForCountTokens( responseNode = countTokensResponseFromMldev(responseNode, null, parameterNode); } - CountTokensResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, CountTokensResponse.class); + CountTokensResponse sdkResponse = Common.fromJsonNode(responseNode, CountTokensResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -7294,7 +7206,7 @@ public CountTokensResponse countTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForCountTokens(model, contents, config); try (ApiResponse response = @@ -7319,7 +7231,7 @@ BuiltRequest buildRequestForComputeTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -7345,7 +7257,7 @@ BuiltRequest buildRequestForComputeTokens( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -7359,7 +7271,7 @@ ComputeTokensResponse processResponseForComputeTokens( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = computeTokensResponseFromVertex(responseNode, null, parameterNode); @@ -7372,7 +7284,7 @@ ComputeTokensResponse processResponseForComputeTokens( } ComputeTokensResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ComputeTokensResponse.class); + Common.fromJsonNode(responseNode, ComputeTokensResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -7407,7 +7319,7 @@ public ComputeTokensResponse computeTokens( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForComputeTokens(model, contents, config); try (ApiResponse response = @@ -7446,7 +7358,7 @@ BuiltRequest buildRequestForPrivateGenerateVideos( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -7475,7 +7387,7 @@ BuiltRequest buildRequestForPrivateGenerateVideos( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -7489,7 +7401,7 @@ GenerateVideosOperation processResponseForPrivateGenerateVideos( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = generateVideosOperationFromVertex(responseNode, null, parameterNode); @@ -7499,7 +7411,7 @@ GenerateVideosOperation processResponseForPrivateGenerateVideos( responseNode = generateVideosOperationFromMldev(responseNode, null, parameterNode); } - return JsonSerializable.fromJsonNode(responseNode, GenerateVideosOperation.class); + return Common.fromJsonNode(responseNode, GenerateVideosOperation.class); } /** Private method for generating videos. */ @@ -7530,7 +7442,7 @@ GenerateVideosOperation privateGenerateVideos( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateGenerateVideos(model, prompt, image, video, source, config); diff --git a/src/main/java/com/google/genai/Operations.java b/src/main/java/com/google/genai/Operations.java index 35f2ac56abd..979e088c45c 100644 --- a/src/main/java/com/google/genai/Operations.java +++ b/src/main/java/com/google/genai/Operations.java @@ -52,7 +52,7 @@ public Operations(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode fetchPredictOperationParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -72,7 +72,7 @@ ObjectNode fetchPredictOperationParametersToVertex(JsonNode fromObject, ObjectNo @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -107,7 +107,7 @@ ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNode pare toObject, new String[] {"response"}, generateVideosResponseFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"response", "generateVideoResponse"})), toObject)); @@ -118,7 +118,7 @@ ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosOperationFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -152,8 +152,7 @@ ObjectNode generateVideosOperationFromVertex(JsonNode fromObject, ObjectNode par toObject, new String[] {"response"}, generateVideosResponseFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -162,7 +161,7 @@ ObjectNode generateVideosOperationFromVertex(JsonNode fromObject, ObjectNode par @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"generatedSamples"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"generatedSamples"}); @@ -170,7 +169,7 @@ ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNode paren ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(generatedVideoFromMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(generatedVideoFromMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -194,14 +193,14 @@ ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport ObjectNode generateVideosResponseFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"videos"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"videos"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(generatedVideoFromVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(generatedVideoFromVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -225,14 +224,13 @@ ObjectNode generateVideosResponseFromVertex(JsonNode fromObject, ObjectNode pare @ExcludeFromGeneratedCoverageReport ObjectNode generatedVideoFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"video"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject)); } @@ -241,14 +239,13 @@ ObjectNode generatedVideoFromMldev(JsonNode fromObject, ObjectNode parentObject) @ExcludeFromGeneratedCoverageReport ObjectNode generatedVideoFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject)); } @@ -257,7 +254,7 @@ ObjectNode generatedVideoFromVertex(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode getOperationParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -270,7 +267,7 @@ ObjectNode getOperationParametersToMldev(JsonNode fromObject, ObjectNode parentO @ExcludeFromGeneratedCoverageReport ObjectNode getOperationParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -283,7 +280,7 @@ ObjectNode getOperationParametersToVertex(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uri"}) != null) { Common.setValueByPath( toObject, new String[] {"uri"}, Common.getValueByPath(fromObject, new String[] {"uri"})); @@ -308,7 +305,7 @@ ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode videoFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, @@ -346,7 +343,7 @@ BuiltRequest buildRequestForPrivateGetVideosOperation( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -375,7 +372,7 @@ BuiltRequest buildRequestForPrivateGetVideosOperation( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -389,7 +386,7 @@ JsonNode processResponseForPrivateGetVideosOperation( throw new GenAiIOException("Failed to read HTTP response.", e); } - return JsonSerializable.stringToJsonNode(responseString); + return Common.stringToJsonNode(responseString); } JsonNode privateGetVideosOperation(String operationName, GetOperationConfig config) { @@ -418,7 +415,7 @@ BuiltRequest buildRequestForPrivateFetchPredictVideosOperation( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -444,7 +441,7 @@ BuiltRequest buildRequestForPrivateFetchPredictVideosOperation( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -458,7 +455,7 @@ JsonNode processResponseForPrivateFetchPredictVideosOperation( throw new GenAiIOException("Failed to read HTTP response.", e); } - return JsonSerializable.stringToJsonNode(responseString); + return Common.stringToJsonNode(responseString); } JsonNode privateFetchPredictVideosOperation( diff --git a/src/main/java/com/google/genai/OperationsConverters.java b/src/main/java/com/google/genai/OperationsConverters.java index c0816203095..2351c3ec6e5 100644 --- a/src/main/java/com/google/genai/OperationsConverters.java +++ b/src/main/java/com/google/genai/OperationsConverters.java @@ -37,7 +37,7 @@ public OperationsConverters(ApiClient apiClient) { @InternalApi public ObjectNode fetchPredictOperationParametersToMldev( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"operationName"}))) { throw new IllegalArgumentException( "operationName parameter is only supported in Gemini Enterprise Agent Platform mode, not" @@ -63,7 +63,7 @@ public ObjectNode fetchPredictOperationParametersToMldev( @InternalApi public ObjectNode fetchPredictOperationParametersToVertex( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -84,7 +84,7 @@ public ObjectNode fetchPredictOperationParametersToVertex( @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -119,7 +119,7 @@ public ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNo toObject, new String[] {"response"}, generateVideosResponseFromMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath( fromObject, new String[] {"response", "generateVideoResponse"})), toObject)); @@ -132,7 +132,7 @@ public ObjectNode generateVideosOperationFromMldev(JsonNode fromObject, ObjectNo @InternalApi public ObjectNode generateVideosOperationFromVertex( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -166,8 +166,7 @@ public ObjectNode generateVideosOperationFromVertex( toObject, new String[] {"response"}, generateVideosResponseFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -177,7 +176,7 @@ public ObjectNode generateVideosOperationFromVertex( @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"generatedSamples"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"generatedSamples"}); @@ -185,7 +184,7 @@ public ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNod ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(generatedVideoFromMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(generatedVideoFromMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -210,14 +209,14 @@ public ObjectNode generateVideosResponseFromMldev(JsonNode fromObject, ObjectNod @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode generateVideosResponseFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"videos"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"videos"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(generatedVideoFromVertex(JsonSerializable.toJsonNode(item), toObject)); + result.add(generatedVideoFromVertex(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"generatedVideos"}, result); } @@ -242,14 +241,13 @@ public ObjectNode generateVideosResponseFromVertex(JsonNode fromObject, ObjectNo @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode generatedVideoFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"video"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"video"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"video"})), toObject)); } @@ -259,14 +257,13 @@ public ObjectNode generatedVideoFromMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode generatedVideoFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"_self"}) != null) { Common.setValueByPath( toObject, new String[] {"video"}, videoFromVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject)); } @@ -276,7 +273,7 @@ public ObjectNode generatedVideoFromVertex(JsonNode fromObject, ObjectNode paren @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode getOperationParametersToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -290,7 +287,7 @@ public ObjectNode getOperationParametersToMldev(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode getOperationParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"operationName"}) != null) { Common.setValueByPath( toObject, @@ -304,7 +301,7 @@ public ObjectNode getOperationParametersToVertex(JsonNode fromObject, ObjectNode @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -338,8 +335,7 @@ public ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode p toObject, new String[] {"response"}, importFileResponseFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -349,7 +345,7 @@ public ObjectNode importFileOperationFromMldev(JsonNode fromObject, ObjectNode p @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode importFileResponseFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -378,7 +374,7 @@ public ObjectNode importFileResponseFromMldev(JsonNode fromObject, ObjectNode pa @InternalApi public ObjectNode uploadToFileSearchStoreOperationFromMldev( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -412,8 +408,7 @@ public ObjectNode uploadToFileSearchStoreOperationFromMldev( toObject, new String[] {"response"}, uploadToFileSearchStoreResponseFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"response"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"response"})), toObject)); } @@ -424,7 +419,7 @@ public ObjectNode uploadToFileSearchStoreOperationFromMldev( @InternalApi public ObjectNode uploadToFileSearchStoreResponseFromMldev( JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -452,7 +447,7 @@ public ObjectNode uploadToFileSearchStoreResponseFromMldev( @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"uri"}) != null) { Common.setValueByPath( toObject, new String[] {"uri"}, Common.getValueByPath(fromObject, new String[] {"uri"})); @@ -478,7 +473,7 @@ public ObjectNode videoFromMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport @InternalApi public ObjectNode videoFromVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, diff --git a/src/main/java/com/google/genai/Pager.java b/src/main/java/com/google/genai/Pager.java index f9387f1244e..802145c8a66 100644 --- a/src/main/java/com/google/genai/Pager.java +++ b/src/main/java/com/google/genai/Pager.java @@ -98,9 +98,8 @@ private void fetchNextPage() { try { initNewPage( - JsonSerializable.toJsonNode( - request.apply( - JsonSerializable.fromJsonNode(requestConfig, pagedItem.requestConfigClass())))); + Common.toJsonNode( + request.apply(Common.fromJsonNode(requestConfig, pagedItem.requestConfigClass())))); this.currentIndex = 0; } catch (Exception e) { throw new GenAiIOException("Failed to fetch the next page. " + e.getMessage()); diff --git a/src/main/java/com/google/genai/ReplayApiClient.java b/src/main/java/com/google/genai/ReplayApiClient.java index 57f3abfc486..9dde5daf7b9 100644 --- a/src/main/java/com/google/genai/ReplayApiClient.java +++ b/src/main/java/com/google/genai/ReplayApiClient.java @@ -218,10 +218,9 @@ private void matchRequest(ReplayRequest replayRequest, Request actualRequest) { return; } JsonNode actualBody = - redactRequestBody( - JsonSerializable.stringToJsonNode(requestBodyToString(actualRequest.body()))); + redactRequestBody(Common.stringToJsonNode(requestBodyToString(actualRequest.body()))); JsonNode replayBody = - JsonSerializable.toJsonNode(replayRequest.bodySegments().orElse(new ArrayList<>()).get(0)); + Common.toJsonNode(replayRequest.bodySegments().orElse(new ArrayList<>()).get(0)); if (!equalsIgnoreKeyCase(replayBody, actualBody)) { throw new AssertionError( String.format( @@ -236,8 +235,7 @@ private ReplayApiResponse buildResponseFromReplay( if (replayResponse == null) { throw new IllegalArgumentException("Replay response is null."); } - JsonNode bodyNode = - JsonSerializable.toJsonNode(replayResponse.bodySegments().orElse(new ArrayList<>())); + JsonNode bodyNode = Common.toJsonNode(replayResponse.bodySegments().orElse(new ArrayList<>())); Headers headers = Headers.of(replayResponse.headers().orElse(ImmutableMap.of())); return new ReplayApiResponse( (ArrayNode) bodyNode, replayResponse.statusCode().orElse(0), headers, isStream); @@ -303,7 +301,7 @@ private static Map redactRequestHeaders(Map head /** Redact the request body to make it robust to replay files. */ private static JsonNode redactRequestBody(JsonNode requestBody) { - ObjectNode redactedNode = JsonSerializable.objectMapper.createObjectNode(); + ObjectNode redactedNode = Common.objectMapper.createObjectNode(); requestBody .fields() .forEachRemaining( @@ -311,7 +309,7 @@ private static JsonNode redactRequestBody(JsonNode requestBody) { if (entry.getValue().isTextual()) { redactedNode.set( entry.getKey(), - JsonSerializable.toJsonNode( + Common.toJsonNode( entry .getValue() .asText() @@ -351,28 +349,28 @@ private static Object normalizeKeyCase(Object obj) { } else if (obj instanceof JsonNode) { JsonNode node = (JsonNode) obj; if (node.isObject()) { - ObjectNode normalizedNode = JsonSerializable.objectMapper.createObjectNode(); + ObjectNode normalizedNode = Common.objectMapper.createObjectNode(); node.fields() .forEachRemaining( entry -> { String newKey = Common.snakeToCamel(entry.getKey()); Object normalizedValue = normalizeKeyCase(entry.getValue()); - normalizedNode.set(newKey, JsonSerializable.toJsonNode(normalizedValue)); + normalizedNode.set(newKey, Common.toJsonNode(normalizedValue)); }); return normalizedNode; } else if (node.isArray()) { - ArrayNode normalizedNode = JsonSerializable.objectMapper.createArrayNode(); + ArrayNode normalizedNode = Common.objectMapper.createArrayNode(); node.elements() .forEachRemaining( item -> { - normalizedNode.add(JsonSerializable.toJsonNode(normalizeKeyCase(item))); + normalizedNode.add(Common.toJsonNode(normalizeKeyCase(item))); }); return normalizedNode; } else if (node.isTextual()) { // In the replay file, the timestamp has +00:00 offset, while in the // actual request it uses Z to represent the offset. We need to // replace it to match the replay file. - return JsonSerializable.toJsonNode(node.asText().replaceAll("(?<=00)Z$", "\\+00:00")); + return Common.toJsonNode(node.asText().replaceAll("(?<=00)Z$", "\\+00:00")); } } return obj; diff --git a/src/main/java/com/google/genai/ReplayApiResponse.java b/src/main/java/com/google/genai/ReplayApiResponse.java index 4e58bb70b49..4d4febcbac1 100644 --- a/src/main/java/com/google/genai/ReplayApiResponse.java +++ b/src/main/java/com/google/genai/ReplayApiResponse.java @@ -53,7 +53,7 @@ public ReplayApiResponse( byte[] doubleNewline = "\n\n".getBytes(StandardCharsets.UTF_8); for (JsonNode segment : bodySegments) { outputStream.write(dataPrefix); - outputStream.write(JsonSerializable.objectMapper.writeValueAsBytes(segment)); + outputStream.write(Common.objectMapper.writeValueAsBytes(segment)); outputStream.write(doubleNewline); } this.body = @@ -65,8 +65,7 @@ public ReplayApiResponse( // For unary response this.body = ResponseBody.create( - JsonSerializable.toJsonString(bodySegments.get(0)), - MediaType.parse("application/json")); + Common.toJsonString(bodySegments.get(0)), MediaType.parse("application/json")); } } diff --git a/src/main/java/com/google/genai/ResponseStream.java b/src/main/java/com/google/genai/ResponseStream.java index 9065308abbe..6407ee2d8f8 100644 --- a/src/main/java/com/google/genai/ResponseStream.java +++ b/src/main/java/com/google/genai/ResponseStream.java @@ -116,7 +116,7 @@ public T next() { String currentJson = nextJson; nextJson = readNextJson(); try { - JsonNode currentJsonNode = JsonSerializable.stringToJsonNode(currentJson); + JsonNode currentJsonNode = Common.stringToJsonNode(currentJson); if (currentJsonNode.isObject() && currentJsonNode.has("error")) { int extractedCode = 500; @@ -124,18 +124,18 @@ public T next() { if (errorNode.has("code") && errorNode.get("code").isInt()) { extractedCode = errorNode.get("code").asInt(); } - ArrayNode arrayNode = JsonSerializable.objectMapper.createArrayNode(); + ArrayNode arrayNode = Common.objectMapper.createArrayNode(); arrayNode.add(currentJsonNode); ApiException.throwFromErrorNode(arrayNode, extractedCode); } if (responseHeaders != null && currentJsonNode.isObject()) { ObjectNode rootNode = (ObjectNode) currentJsonNode; - ObjectNode headersNode = JsonSerializable.objectMapper.createObjectNode(); + ObjectNode headersNode = Common.objectMapper.createObjectNode(); for (String headerName : responseHeaders.names()) { headersNode.put(headerName, responseHeaders.get(headerName)); } - ObjectNode sdkHttpResponseNode = JsonSerializable.objectMapper.createObjectNode(); + ObjectNode sdkHttpResponseNode = Common.objectMapper.createObjectNode(); sdkHttpResponseNode.set("headers", headersNode); rootNode.set("sdkHttpResponse", sdkHttpResponseNode); currentJsonNode = rootNode; @@ -147,7 +147,7 @@ public T next() { currentJsonNode = (JsonNode) converter.invoke(obj, currentJsonNode, null); } - T response = JsonSerializable.fromJsonNode(currentJsonNode, clazz); + T response = Common.fromJsonNode(currentJsonNode, clazz); if (recordingHistory) { history.add(response); } diff --git a/src/main/java/com/google/genai/Tokens.java b/src/main/java/com/google/genai/Tokens.java index 116c2cadfa2..f42be2d6451 100644 --- a/src/main/java/com/google/genai/Tokens.java +++ b/src/main/java/com/google/genai/Tokens.java @@ -189,7 +189,7 @@ BuiltRequest buildRequestForCreate(CreateAuthTokenConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -221,8 +221,7 @@ BuiltRequest buildRequestForCreate(CreateAuthTokenConfig config) { ObjectNode transformedBody = convertBidiSetupToTokenSetup(body, config); transformedBody.remove("config"); - return new BuiltRequest( - path, JsonSerializable.toJsonString(transformedBody), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(transformedBody), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -235,9 +234,9 @@ AuthToken processResponseForCreate(ApiResponse response, CreateAuthTokenConfig c throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); - return JsonSerializable.fromJsonNode(responseNode, AuthToken.class); + return Common.fromJsonNode(responseNode, AuthToken.class); } /** diff --git a/src/main/java/com/google/genai/TokensConverters.java b/src/main/java/com/google/genai/TokensConverters.java index 8fd7e951813..4aa6fb7ec1e 100644 --- a/src/main/java/com/google/genai/TokensConverters.java +++ b/src/main/java/com/google/genai/TokensConverters.java @@ -33,7 +33,7 @@ public TokensConverters(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"apiKey"}) != null) { Common.setValueByPath( toObject, @@ -83,7 +83,7 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) { Common.setValueByPath( toObject, @@ -109,14 +109,14 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"parts"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"parts"}); ObjectMapper objectMapper = new ObjectMapper(); ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(partToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(partToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(toObject, new String[] {"parts"}, result); } @@ -134,7 +134,7 @@ ObjectNode contentToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode createAuthTokenConfigToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"expireTime"}) != null) { Common.setValueByPath( @@ -163,7 +163,7 @@ ObjectNode createAuthTokenConfigToMldev( new String[] {"bidiGenerateContentSetup"}, liveConnectConstraintsToMldev( apiClient, - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"liveConnectConstraints"})), toObject)); } @@ -181,15 +181,14 @@ ObjectNode createAuthTokenConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createAuthTokenParametersToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { Common.setValueByPath( toObject, new String[] {"config"}, createAuthTokenConfigToMldev( apiClient, - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject)); } @@ -198,7 +197,7 @@ ObjectNode createAuthTokenParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createAuthTokenParametersToVertex(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"config"}))) { throw new IllegalArgumentException( "config parameter is only supported in Gemini Developer API mode, not in Gemini" @@ -210,7 +209,7 @@ ObjectNode createAuthTokenParametersToVertex(JsonNode fromObject, ObjectNode par @ExcludeFromGeneratedCoverageReport ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) { throw new IllegalArgumentException( "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -236,7 +235,7 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) { Common.setValueByPath( toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"})); @@ -273,14 +272,13 @@ ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"authConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"authConfig"}, authConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"authConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"authConfig"})), toObject)); } @@ -302,7 +300,7 @@ ObjectNode googleMapsToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"searchTypes"}) != null) { Common.setValueByPath( toObject, @@ -334,7 +332,7 @@ ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"responseModalities"}) != null) { Common.setValueByPath( @@ -412,7 +410,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject parentObject, new String[] {"setup", "systemInstruction"}, contentToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Transformers.tContent( Common.getValueByPath(fromObject, new String[] {"systemInstruction"}))), toObject)); @@ -426,7 +424,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(toolToMldev(JsonSerializable.toJsonNode(Transformers.tTool(item)), toObject)); + result.add(toolToMldev(Common.toJsonNode(Transformers.tTool(item)), toObject)); } Common.setValueByPath(parentObject, new String[] {"setup", "tools"}, result); } @@ -436,7 +434,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject parentObject, new String[] {"setup", "sessionResumption"}, sessionResumptionConfigToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"sessionResumption"})), toObject)); } @@ -496,7 +494,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(safetySettingToMldev(JsonSerializable.toJsonNode(item), toObject)); + result.add(safetySettingToMldev(Common.toJsonNode(item), toObject)); } Common.setValueByPath(parentObject, new String[] {"setup", "safetySettings"}, result); } @@ -514,7 +512,7 @@ ObjectNode liveConnectConfigToMldev(JsonNode fromObject, ObjectNode parentObject @ExcludeFromGeneratedCoverageReport ObjectNode liveConnectConstraintsToMldev( ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"model"}) != null) { Common.setValueByPath( toObject, @@ -528,8 +526,7 @@ ObjectNode liveConnectConstraintsToMldev( toObject, new String[] {"config"}, liveConnectConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject)); } @@ -538,7 +535,7 @@ ObjectNode liveConnectConstraintsToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mediaResolution"}) != null) { Common.setValueByPath( toObject, @@ -565,8 +562,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"fileData"}, fileDataToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"fileData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"fileData"})), toObject)); } @@ -575,8 +571,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"functionCall"}, functionCallToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"functionCall"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"functionCall"})), toObject)); } @@ -592,8 +587,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"inlineData"}, blobToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"inlineData"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"inlineData"})), toObject)); } @@ -658,7 +652,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"category"}) != null) { Common.setValueByPath( toObject, @@ -684,7 +678,7 @@ ObjectNode safetySettingToMldev(JsonNode fromObject, ObjectNode parentObject) { @ExcludeFromGeneratedCoverageReport ObjectNode sessionResumptionConfigToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"handle"}) != null) { Common.setValueByPath( toObject, @@ -703,7 +697,7 @@ ObjectNode sessionResumptionConfigToMldev(JsonNode fromObject, ObjectNode parent @ExcludeFromGeneratedCoverageReport ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"retrieval"}))) { throw new IllegalArgumentException( "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -729,8 +723,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleSearch"}, googleSearchToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleSearch"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleSearch"})), toObject)); } @@ -739,8 +732,7 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) { toObject, new String[] {"googleMaps"}, googleMapsToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"googleMaps"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"googleMaps"})), toObject)); } diff --git a/src/main/java/com/google/genai/Transformers.java b/src/main/java/com/google/genai/Transformers.java index 75cd95be605..da639f6d5f8 100644 --- a/src/main/java/com/google/genai/Transformers.java +++ b/src/main/java/com/google/genai/Transformers.java @@ -70,7 +70,7 @@ public static String tModel(ApiClient apiClient, Object origin) { } else if (origin instanceof String) { model = (String) origin; } else if (origin instanceof JsonNode) { - model = JsonSerializable.toJsonString((JsonNode) origin); + model = Common.toJsonString((JsonNode) origin); model = model.replace("\"", ""); } else { throw new IllegalArgumentException("Unsupported model type: " + origin.getClass()); @@ -155,7 +155,7 @@ public static String tModelsUrl(ApiClient apiClient, @Nullable Object baseModels if ((response.get("httpHeaders") == null) || (response.get("jsonPayload") != null)) { logger.warning("Cannot determine the models type for response: " + response.toPrettyString()); } - return JsonSerializable.objectMapper.createArrayNode(); + return Common.objectMapper.createArrayNode(); } /** @@ -209,7 +209,7 @@ public static Content tContent(Object content) { } else if (content instanceof Content) { return (Content) content; } else if (content instanceof JsonNode) { - return JsonSerializable.fromJsonNode((JsonNode) content, Content.class); + return Common.fromJsonNode((JsonNode) content, Content.class); } throw new IllegalArgumentException("Unsupported content type: " + content.getClass()); @@ -222,7 +222,7 @@ public static Schema tSchema(Object origin) { } else if (origin instanceof Schema) { return (Schema) origin; } else if (origin instanceof JsonNode) { - return JsonSerializable.fromJsonNode((JsonNode) origin, Schema.class); + return Common.fromJsonNode((JsonNode) origin, Schema.class); } throw new IllegalArgumentException("Unsupported schema type: " + origin.getClass()); } @@ -241,7 +241,7 @@ public static SpeechConfig tSpeechConfig(Object speechConfig) { } else if (speechConfig instanceof SpeechConfig) { return (SpeechConfig) speechConfig; } else if (speechConfig instanceof JsonNode) { - return JsonSerializable.fromJsonNode((JsonNode) speechConfig, SpeechConfig.class); + return Common.fromJsonNode((JsonNode) speechConfig, SpeechConfig.class); } throw new IllegalArgumentException("Unsupported speechConfig type:" + speechConfig.getClass()); @@ -262,7 +262,7 @@ public static SpeechConfig tSpeechConfig(Object speechConfig) { } else if (origin instanceof SpeechConfig) { speechConfig = (SpeechConfig) origin; } else if (origin instanceof JsonNode) { - speechConfig = JsonSerializable.fromJsonNode((JsonNode) origin, SpeechConfig.class); + speechConfig = Common.fromJsonNode((JsonNode) origin, SpeechConfig.class); } else { throw new IllegalArgumentException("Unsupported speechConfig type:" + origin.getClass()); } @@ -301,18 +301,16 @@ public static Tool tTool(Object origin) { if (tool.functionDeclarations().isPresent()) { combinedFunctionDeclarations.addAll(tool.functionDeclarations().get()); } - ObjectNode toolNode = JsonSerializable.objectMapper.valueToTree(tool); + ObjectNode toolNode = Common.objectMapper.valueToTree(tool); toolNode.remove("functions"); toolNode.set( - "functionDeclarations", - JsonSerializable.objectMapper.valueToTree(combinedFunctionDeclarations)); - return JsonSerializable.fromJsonNode(toolNode, Tool.class); + "functionDeclarations", Common.objectMapper.valueToTree(combinedFunctionDeclarations)); + return Common.fromJsonNode(toolNode, Tool.class); } else if (origin instanceof JsonNode) { // in case reflectMethods is present in the json node, call tTool to parse it and remove it // from the json node. return tTool( - JsonSerializable.objectMapper.convertValue( - (JsonNode) origin, new TypeReference() {})); + Common.objectMapper.convertValue((JsonNode) origin, new TypeReference() {})); } throw new IllegalArgumentException("Unsupported tool type: " + origin.getClass()); @@ -323,7 +321,7 @@ public static ArrayNode tBlobs(Object origin) { // 1. Check if the origin is a JsonNode if (!(origin instanceof JsonNode)) { // If origin is not a JsonNode, we create one from the object. - origin = JsonSerializable.toJsonNode(origin); + origin = Common.toJsonNode(origin); } JsonNode inputNode = (JsonNode) origin; @@ -335,14 +333,13 @@ public static ArrayNode tBlobs(Object origin) { // 2. If it's not an array, create a new array and add the input to it. ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); - arrayNode.add(JsonSerializable.toJsonNode(tBlob(origin))); + arrayNode.add(Common.toJsonNode(tBlob(origin))); return arrayNode; } public static Blob tBlob(Object blob) { if (blob instanceof JsonNode) { - blob = - JsonSerializable.objectMapper.convertValue((JsonNode) blob, new TypeReference() {}); + blob = Common.objectMapper.convertValue((JsonNode) blob, new TypeReference() {}); } if (blob instanceof Blob) { @@ -399,7 +396,7 @@ public static String tCachedContentName(ApiClient apiClient, Object origin) { } else if (origin instanceof String) { return getResourceName(apiClient, (String) origin, "cachedContents"); } else if (origin instanceof JsonNode) { - String cachedContentName = JsonSerializable.toJsonString((JsonNode) origin); + String cachedContentName = Common.toJsonString((JsonNode) origin); cachedContentName = cachedContentName.replace("\"", ""); return getResourceName(apiClient, cachedContentName, "cachedContents"); } @@ -420,7 +417,7 @@ public static String tCachedContentName(ApiClient apiClient, Object origin) { contents = (List) origin; } else if (origin instanceof JsonNode) { contents = - JsonSerializable.objectMapper.convertValue( + Common.objectMapper.convertValue( (JsonNode) origin, new TypeReference>() {}); } else { throw new IllegalArgumentException("Unsupported contents type: " + origin.getClass()); @@ -603,7 +600,7 @@ public static String tBatchJobName(ApiClient apiClient, Object name) { if (name instanceof String) { nameStr = (String) name; } else if (name instanceof JsonNode) { - nameStr = JsonSerializable.toJsonString((JsonNode) name); + nameStr = Common.toJsonString((JsonNode) name); nameStr = nameStr.replace("\"", ""); } else { throw new IllegalArgumentException("Unsupported batch job name type: " + name.getClass()); @@ -647,7 +644,7 @@ public static Object tJobState(Object state) { if (state instanceof String) { stateStr = (String) state; } else if (state instanceof JsonNode) { - stateStr = JsonSerializable.toJsonString(state); + stateStr = Common.toJsonString(state); stateStr = stateStr.replace("\"", ""); } else { throw new IllegalArgumentException("Unsupported job state type: " + state.getClass()); @@ -681,34 +678,7 @@ public static Object tJobState(Object state) { * @throws IllegalArgumentException if a value cannot be set for an existing key. */ public static void updateJsonNode(ObjectNode currentObject, String keyToSet, JsonNode valueNode) { - JsonNode existingData = currentObject.get(keyToSet); - - if (existingData != null) { - // Don't overwrite existing non-empty value with new empty value. - if (valueNode == null || valueNode.isNull() || valueNode.isEmpty()) { - return; - } - - // Don't fail when overwriting value with same value - if (valueNode.equals(existingData)) { - return; - } - - // Instead of overwriting dictionary with another dictionary, merge them. - if (existingData.isObject() && valueNode.isObject()) { - ((ObjectNode) existingData).setAll((ObjectNode) valueNode); - } else { - throw new IllegalArgumentException( - "Cannot set value for an existing key. Key: " - + keyToSet - + "; Existing value: " - + existingData - + "; New value: " - + valueNode); - } - } else { - currentObject.set(keyToSet, valueNode); - } + Common.updateJsonNode(currentObject, keyToSet, valueNode); } /** @@ -753,7 +723,7 @@ public static ArrayNode tMetrics(Object metrics) { List metricsPayload = new ArrayList<>(); for (UnifiedMetric metricObj : metricsList) { - ObjectNode metricPayloadItem = (ObjectNode) JsonSerializable.toJsonNode(metricObj); + ObjectNode metricPayloadItem = (ObjectNode) Common.toJsonNode(metricObj); ArrayNode aggregationMetrics = JsonNodeFactory.instance.arrayNode(); aggregationMetrics.add("AVERAGE"); aggregationMetrics.add("STANDARD_DEVIATION"); diff --git a/src/main/java/com/google/genai/Tunings.java b/src/main/java/com/google/genai/Tunings.java index 2de93d0d9cc..5d88ba7415f 100644 --- a/src/main/java/com/google/genai/Tunings.java +++ b/src/main/java/com/google/genai/Tunings.java @@ -60,7 +60,7 @@ public Tunings(ApiClient apiClient) { @ExcludeFromGeneratedCoverageReport ObjectNode cancelTuningJobParametersToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -74,7 +74,7 @@ ObjectNode cancelTuningJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode cancelTuningJobParametersToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -88,7 +88,7 @@ ObjectNode cancelTuningJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode cancelTuningJobResponseFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -102,7 +102,7 @@ ObjectNode cancelTuningJobResponseFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode cancelTuningJobResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -116,7 +116,7 @@ ObjectNode cancelTuningJobResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode createTuningJobConfigToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"validationDataset"}))) { throw new IllegalArgumentException( @@ -301,7 +301,7 @@ ObjectNode createTuningJobConfigToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createTuningJobConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); JsonNode discriminatorValidationDataset = (JsonNode) Common.getValueByPath(rootObject, new String[] {"config", "method"}); @@ -315,7 +315,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"supervisedTuningSpec"}, tuningValidationDatasetToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"validationDataset"})), toObject, rootObject)); @@ -326,7 +326,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"preferenceOptimizationSpec"}, tuningValidationDatasetToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"validationDataset"})), toObject, rootObject)); @@ -337,7 +337,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"distillationSpec"}, tuningValidationDatasetToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"validationDataset"})), toObject, rootObject)); @@ -348,7 +348,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"reinforcementTuningSpec"}, tuningValidationDatasetToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"validationDataset"})), toObject, rootObject)); @@ -596,7 +596,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"supervisedTuningSpec", "evaluationConfig"}, evaluationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"evaluationConfig"})), toObject, rootObject)); @@ -607,7 +607,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"preferenceOptimizationSpec", "evaluationConfig"}, evaluationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"evaluationConfig"})), toObject, rootObject)); @@ -618,7 +618,7 @@ ObjectNode createTuningJobConfigToVertex( parentObject, new String[] {"distillationSpec", "evaluationConfig"}, evaluationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"evaluationConfig"})), toObject, rootObject)); @@ -735,7 +735,7 @@ ObjectNode createTuningJobConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode createTuningJobParametersPrivateToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"baseModel"}) != null) { Common.setValueByPath( toObject, @@ -753,7 +753,7 @@ ObjectNode createTuningJobParametersPrivateToMldev( if (Common.getValueByPath(fromObject, new String[] {"trainingDataset"}) != null) { JsonNode unused = tuningDatasetToMldev( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"trainingDataset"})), toObject, rootObject); @@ -762,8 +762,7 @@ ObjectNode createTuningJobParametersPrivateToMldev( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createTuningJobConfigToMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -774,7 +773,7 @@ ObjectNode createTuningJobParametersPrivateToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode createTuningJobParametersPrivateToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"baseModel"}) != null) { Common.setValueByPath( toObject, @@ -792,7 +791,7 @@ ObjectNode createTuningJobParametersPrivateToVertex( if (Common.getValueByPath(fromObject, new String[] {"trainingDataset"}) != null) { JsonNode unused = tuningDatasetToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"trainingDataset"})), toObject, rootObject); @@ -801,8 +800,7 @@ ObjectNode createTuningJobParametersPrivateToVertex( if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = createTuningJobConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -813,7 +811,7 @@ ObjectNode createTuningJobParametersPrivateToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode distillationHyperParametersFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"adapterSize"}) != null) { Common.setValueByPath( toObject, @@ -840,7 +838,7 @@ ObjectNode distillationHyperParametersFromVertex( toObject, new String[] {"generationConfig"}, generationConfigFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"generationConfig"})), toObject, rootObject)); @@ -866,7 +864,7 @@ ObjectNode distillationHyperParametersFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode distillationSamplingSpecFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"baseTeacherModel"}) != null) { Common.setValueByPath( toObject, @@ -900,7 +898,7 @@ ObjectNode distillationSamplingSpecFromVertex( toObject, new String[] {"hyperparameters"}, distillationHyperParametersFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"hyperparameters"})), toObject, rootObject)); @@ -912,7 +910,7 @@ ObjectNode distillationSamplingSpecFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode distillationSpecFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"promptDatasetUri"}) != null) { Common.setValueByPath( toObject, @@ -932,7 +930,7 @@ ObjectNode distillationSpecFromVertex( toObject, new String[] {"hyperParameters"}, distillationHyperParametersFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"hyperParameters"})), toObject, rootObject)); @@ -986,7 +984,7 @@ ObjectNode distillationSpecFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode evaluationConfigFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"metrics"}) != null) { Common.setValueByPath( toObject, @@ -1013,7 +1011,7 @@ ObjectNode evaluationConfigFromVertex( toObject, new String[] {"inferenceGenerationConfig"}, generationConfigFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"inferenceGenerationConfig"})), toObject, rootObject)); @@ -1025,7 +1023,7 @@ ObjectNode evaluationConfigFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode evaluationConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"metrics"}) != null) { Common.setValueByPath( toObject, @@ -1052,7 +1050,7 @@ ObjectNode evaluationConfigToVertex( toObject, new String[] {"inferenceGenerationConfig"}, generationConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"inferenceGenerationConfig"})), toObject, rootObject)); @@ -1064,7 +1062,7 @@ ObjectNode evaluationConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generationConfigFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"modelConfig"}) != null) { Common.setValueByPath( toObject, @@ -1239,7 +1237,7 @@ ObjectNode generationConfigFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode generationConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"modelSelectionConfig"}) != null) { Common.setValueByPath( toObject, @@ -1357,8 +1355,7 @@ ObjectNode generationConfigToVertex( toObject, new String[] {"speechConfig"}, speechConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"speechConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"speechConfig"})), toObject, rootObject)); } @@ -1431,7 +1428,7 @@ ObjectNode generationConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode getTuningJobParametersToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1445,7 +1442,7 @@ ObjectNode getTuningJobParametersToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode getTuningJobParametersToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1459,7 +1456,7 @@ ObjectNode getTuningJobParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode listTuningJobsConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"pageSize"}) != null) { Common.setValueByPath( @@ -1488,12 +1485,11 @@ ObjectNode listTuningJobsConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode listTuningJobsParametersToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"config"}) != null) { JsonNode unused = listTuningJobsConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"config"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"config"})), toObject, rootObject); } @@ -1504,7 +1500,7 @@ ObjectNode listTuningJobsParametersToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode listTuningJobsResponseFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1526,7 +1522,7 @@ ObjectNode listTuningJobsResponseFromVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add(tuningJobFromVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(tuningJobFromVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"tuningJobs"}, result); } @@ -1537,7 +1533,7 @@ ObjectNode listTuningJobsResponseFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode multiSpeakerVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}) != null) { ArrayNode keyArray = (ArrayNode) Common.getValueByPath(fromObject, new String[] {"speakerVoiceConfigs"}); @@ -1545,8 +1541,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex( ArrayNode result = objectMapper.createArrayNode(); for (JsonNode item : keyArray) { - result.add( - speakerVoiceConfigToVertex(JsonSerializable.toJsonNode(item), toObject, rootObject)); + result.add(speakerVoiceConfigToVertex(Common.toJsonNode(item), toObject, rootObject)); } Common.setValueByPath(toObject, new String[] {"speakerVoiceConfigs"}, result); } @@ -1557,7 +1552,7 @@ ObjectNode multiSpeakerVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode replicatedVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) { Common.setValueByPath( toObject, @@ -1590,7 +1585,7 @@ ObjectNode replicatedVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode speakerVoiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"speaker"}) != null) { Common.setValueByPath( toObject, @@ -1603,8 +1598,7 @@ ObjectNode speakerVoiceConfigToVertex( toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject, rootObject)); } @@ -1615,14 +1609,13 @@ ObjectNode speakerVoiceConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode speechConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"voiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"voiceConfig"}, voiceConfigToVertex( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"voiceConfig"})), toObject, rootObject)); } @@ -1639,7 +1632,7 @@ ObjectNode speechConfigToVertex( toObject, new String[] {"multiSpeakerVoiceConfig"}, multiSpeakerVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"multiSpeakerVoiceConfig"})), toObject, rootObject)); @@ -1651,7 +1644,7 @@ ObjectNode speechConfigToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode tunedModelFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"name"}) != null) { Common.setValueByPath( toObject, @@ -1672,7 +1665,7 @@ ObjectNode tunedModelFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode tuningDatasetToMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"gcsUri"}))) { throw new IllegalArgumentException( "gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in" @@ -1698,7 +1691,7 @@ ObjectNode tuningDatasetToMldev( @ExcludeFromGeneratedCoverageReport ObjectNode tuningDatasetToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); JsonNode discriminatorGcsUri = (JsonNode) Common.getValueByPath(rootObject, new String[] {"config", "method"}); @@ -1780,7 +1773,7 @@ ObjectNode tuningDatasetToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode tuningJobFromMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1849,8 +1842,7 @@ ObjectNode tuningJobFromMldev(JsonNode fromObject, ObjectNode parentObject, Json toObject, new String[] {"tunedModel"}, tunedModelFromMldev( - JsonSerializable.toJsonNode( - Common.getValueByPath(fromObject, new String[] {"_self"})), + Common.toJsonNode(Common.getValueByPath(fromObject, new String[] {"_self"})), toObject, rootObject)); } @@ -1861,7 +1853,7 @@ ObjectNode tuningJobFromMldev(JsonNode fromObject, ObjectNode parentObject, Json @ExcludeFromGeneratedCoverageReport ObjectNode tuningJobFromVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -1965,7 +1957,7 @@ ObjectNode tuningJobFromVertex( toObject, new String[] {"distillationSpec"}, distillationSpecFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"distillationSpec"})), toObject, rootObject)); @@ -2004,7 +1996,7 @@ ObjectNode tuningJobFromVertex( toObject, new String[] {"evaluationConfig"}, evaluationConfigFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"evaluationConfig"})), toObject, rootObject)); @@ -2106,7 +2098,7 @@ ObjectNode tuningJobFromVertex( toObject, new String[] {"distillationSamplingSpec"}, distillationSamplingSpecFromVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"distillationSamplingSpec"})), toObject, rootObject)); @@ -2118,7 +2110,7 @@ ObjectNode tuningJobFromVertex( @ExcludeFromGeneratedCoverageReport ObjectNode tuningOperationFromMldev( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"sdkHttpResponse"}) != null) { Common.setValueByPath( toObject, @@ -2160,7 +2152,7 @@ ObjectNode tuningOperationFromMldev( @ExcludeFromGeneratedCoverageReport ObjectNode tuningValidationDatasetToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"gcsUri"}) != null) { Common.setValueByPath( toObject, @@ -2181,13 +2173,13 @@ ObjectNode tuningValidationDatasetToVertex( @ExcludeFromGeneratedCoverageReport ObjectNode voiceConfigToVertex( JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) { - ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode(); + ObjectNode toObject = Common.objectMapper().createObjectNode(); if (Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"}) != null) { Common.setValueByPath( toObject, new String[] {"replicatedVoiceConfig"}, replicatedVoiceConfigToVertex( - JsonSerializable.toJsonNode( + Common.toJsonNode( Common.getValueByPath(fromObject, new String[] {"replicatedVoiceConfig"})), toObject, rootObject)); @@ -2214,7 +2206,7 @@ BuiltRequest buildRequestForPrivateGet(String name, GetTuningJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2243,7 +2235,7 @@ BuiltRequest buildRequestForPrivateGet(String name, GetTuningJobConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2257,7 +2249,7 @@ TuningJob processResponseForPrivateGet( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = tuningJobFromVertex(responseNode, null, parameterNode); @@ -2267,7 +2259,7 @@ TuningJob processResponseForPrivateGet( responseNode = tuningJobFromMldev(responseNode, null, parameterNode); } - TuningJob sdkResponse = JsonSerializable.fromJsonNode(responseNode, TuningJob.class); + TuningJob sdkResponse = Common.fromJsonNode(responseNode, TuningJob.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2288,7 +2280,7 @@ TuningJob privateGet(String name, GetTuningJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateGet(name, config); try (ApiResponse response = @@ -2306,7 +2298,7 @@ BuiltRequest buildRequestForPrivateList(ListTuningJobsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2332,7 +2324,7 @@ BuiltRequest buildRequestForPrivateList(ListTuningJobsConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2346,7 +2338,7 @@ ListTuningJobsResponse processResponseForPrivateList( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = listTuningJobsResponseFromVertex(responseNode, null, parameterNode); @@ -2359,7 +2351,7 @@ ListTuningJobsResponse processResponseForPrivateList( } ListTuningJobsResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, ListTuningJobsResponse.class); + Common.fromJsonNode(responseNode, ListTuningJobsResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2377,7 +2369,7 @@ ListTuningJobsResponse privateList(ListTuningJobsConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateList(config); try (ApiResponse response = @@ -2398,7 +2390,7 @@ BuiltRequest buildRequestForCancel(String name, CancelTuningJobConfig config) { if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2427,7 +2419,7 @@ BuiltRequest buildRequestForCancel(String name, CancelTuningJobConfig config) { requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2441,7 +2433,7 @@ CancelTuningJobResponse processResponseForCancel( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = cancelTuningJobResponseFromVertex(responseNode, null, parameterNode); @@ -2452,7 +2444,7 @@ CancelTuningJobResponse processResponseForCancel( } CancelTuningJobResponse sdkResponse = - JsonSerializable.fromJsonNode(responseNode, CancelTuningJobResponse.class); + Common.fromJsonNode(responseNode, CancelTuningJobResponse.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2480,7 +2472,7 @@ public CancelTuningJobResponse cancel(String name, CancelTuningJobConfig config) if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForCancel(name, config); try (ApiResponse response = @@ -2512,7 +2504,7 @@ BuiltRequest buildRequestForPrivateTune( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2538,7 +2530,7 @@ BuiltRequest buildRequestForPrivateTune( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2552,7 +2544,7 @@ TuningJob processResponseForPrivateTune( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { responseNode = tuningJobFromVertex(responseNode, null, parameterNode); @@ -2564,7 +2556,7 @@ TuningJob processResponseForPrivateTune( + " Developer API mode."); } - TuningJob sdkResponse = JsonSerializable.fromJsonNode(responseNode, TuningJob.class); + TuningJob sdkResponse = Common.fromJsonNode(responseNode, TuningJob.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2596,7 +2588,7 @@ TuningJob privateTune( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateTune(baseModel, preTunedModel, trainingDataset, config); @@ -2629,7 +2621,7 @@ BuiltRequest buildRequestForPrivateTuneMldev( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); ObjectNode body; String path; @@ -2659,7 +2651,7 @@ BuiltRequest buildRequestForPrivateTuneMldev( requestHttpOptions = config.httpOptions(); } - return new BuiltRequest(path, JsonSerializable.toJsonString(body), requestHttpOptions); + return new BuiltRequest(path, Common.toJsonString(body), requestHttpOptions); } /** A shared processResponse function for both sync and async methods. */ @@ -2673,7 +2665,7 @@ TuningOperation processResponseForPrivateTuneMldev( throw new GenAiIOException("Failed to read HTTP response.", e); } - JsonNode responseNode = JsonSerializable.stringToJsonNode(responseString); + JsonNode responseNode = Common.stringToJsonNode(responseString); if (this.apiClient.vertexAI()) { throw new UnsupportedOperationException( @@ -2685,8 +2677,7 @@ TuningOperation processResponseForPrivateTuneMldev( responseNode = tuningOperationFromMldev(responseNode, null, parameterNode); } - TuningOperation sdkResponse = - JsonSerializable.fromJsonNode(responseNode, TuningOperation.class); + TuningOperation sdkResponse = Common.fromJsonNode(responseNode, TuningOperation.class); Headers responseHeaders = response.getHeaders(); if (responseHeaders == null) { return sdkResponse; @@ -2718,7 +2709,7 @@ TuningOperation privateTuneMldev( if (!Common.isZero(config)) { parameterBuilder.config(config); } - JsonNode parameterNode = JsonSerializable.toJsonNode(parameterBuilder.build()); + JsonNode parameterNode = Common.toJsonNode(parameterBuilder.build()); BuiltRequest builtRequest = buildRequestForPrivateTuneMldev(baseModel, preTunedModel, trainingDataset, config); @@ -2753,8 +2744,8 @@ public Pager list(ListTuningJobsConfig config) { return new Pager<>( Pager.PagedItem.TUNING_JOBS, request, - (ObjectNode) JsonSerializable.toJsonNode(config), - JsonSerializable.toJsonNode(privateList(config))); + (ObjectNode) Common.toJsonNode(config), + Common.toJsonNode(privateList(config))); } /** diff --git a/src/main/java/com/google/genai/types/ActivityEnd.java b/src/main/java/com/google/genai/types/ActivityEnd.java index 24446b34a68..6d95996ce33 100644 --- a/src/main/java/com/google/genai/types/ActivityEnd.java +++ b/src/main/java/com/google/genai/types/ActivityEnd.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -55,6 +56,6 @@ private static Builder create() { /** Deserializes a JSON string to a ActivityEnd object. */ @ExcludeFromGeneratedCoverageReport public static ActivityEnd fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ActivityEnd.class); + return Common.fromJsonString(jsonString, ActivityEnd.class); } } diff --git a/src/main/java/com/google/genai/types/ActivityStart.java b/src/main/java/com/google/genai/types/ActivityStart.java index 1686db78195..923b0eecd2b 100644 --- a/src/main/java/com/google/genai/types/ActivityStart.java +++ b/src/main/java/com/google/genai/types/ActivityStart.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -55,6 +56,6 @@ private static Builder create() { /** Deserializes a JSON string to a ActivityStart object. */ @ExcludeFromGeneratedCoverageReport public static ActivityStart fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ActivityStart.class); + return Common.fromJsonString(jsonString, ActivityStart.class); } } diff --git a/src/main/java/com/google/genai/types/AggregationOutput.java b/src/main/java/com/google/genai/types/AggregationOutput.java index 2d042663fbc..7dc7533998c 100644 --- a/src/main/java/com/google/genai/types/AggregationOutput.java +++ b/src/main/java/com/google/genai/types/AggregationOutput.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -138,6 +139,6 @@ public Builder clearDataset() { /** Deserializes a JSON string to a AggregationOutput object. */ @ExcludeFromGeneratedCoverageReport public static AggregationOutput fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AggregationOutput.class); + return Common.fromJsonString(jsonString, AggregationOutput.class); } } diff --git a/src/main/java/com/google/genai/types/AggregationResult.java b/src/main/java/com/google/genai/types/AggregationResult.java index 92b6b0f4f40..be8f71accc5 100644 --- a/src/main/java/com/google/genai/types/AggregationResult.java +++ b/src/main/java/com/google/genai/types/AggregationResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -293,6 +294,6 @@ public Builder clearRougeMetricValue() { /** Deserializes a JSON string to a AggregationResult object. */ @ExcludeFromGeneratedCoverageReport public static AggregationResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AggregationResult.class); + return Common.fromJsonString(jsonString, AggregationResult.class); } } diff --git a/src/main/java/com/google/genai/types/ApiAuth.java b/src/main/java/com/google/genai/types/ApiAuth.java index bfffc3620fa..47de2a29489 100644 --- a/src/main/java/com/google/genai/types/ApiAuth.java +++ b/src/main/java/com/google/genai/types/ApiAuth.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -90,6 +91,6 @@ public Builder clearApiKeyConfig() { /** Deserializes a JSON string to a ApiAuth object. */ @ExcludeFromGeneratedCoverageReport public static ApiAuth fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ApiAuth.class); + return Common.fromJsonString(jsonString, ApiAuth.class); } } diff --git a/src/main/java/com/google/genai/types/ApiAuthApiKeyConfig.java b/src/main/java/com/google/genai/types/ApiAuthApiKeyConfig.java index 623beda2b0b..9167d862427 100644 --- a/src/main/java/com/google/genai/types/ApiAuthApiKeyConfig.java +++ b/src/main/java/com/google/genai/types/ApiAuthApiKeyConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -102,6 +103,6 @@ public Builder clearApiKeyString() { /** Deserializes a JSON string to a ApiAuthApiKeyConfig object. */ @ExcludeFromGeneratedCoverageReport public static ApiAuthApiKeyConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ApiAuthApiKeyConfig.class); + return Common.fromJsonString(jsonString, ApiAuthApiKeyConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ApiKeyConfig.java b/src/main/java/com/google/genai/types/ApiKeyConfig.java index 6bec0020f30..c97ab2d952b 100644 --- a/src/main/java/com/google/genai/types/ApiKeyConfig.java +++ b/src/main/java/com/google/genai/types/ApiKeyConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -180,6 +181,6 @@ public Builder clearName() { /** Deserializes a JSON string to a ApiKeyConfig object. */ @ExcludeFromGeneratedCoverageReport public static ApiKeyConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ApiKeyConfig.class); + return Common.fromJsonString(jsonString, ApiKeyConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AudioResponseFormat.java b/src/main/java/com/google/genai/types/AudioResponseFormat.java index 070773d7ab4..d9063b7637e 100644 --- a/src/main/java/com/google/genai/types/AudioResponseFormat.java +++ b/src/main/java/com/google/genai/types/AudioResponseFormat.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -166,6 +167,6 @@ public Builder clearSampleRate() { /** Deserializes a JSON string to a AudioResponseFormat object. */ @ExcludeFromGeneratedCoverageReport public static AudioResponseFormat fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AudioResponseFormat.class); + return Common.fromJsonString(jsonString, AudioResponseFormat.class); } } diff --git a/src/main/java/com/google/genai/types/AudioTranscriptionConfig.java b/src/main/java/com/google/genai/types/AudioTranscriptionConfig.java index a7b495bd71a..72d68cbca1e 100644 --- a/src/main/java/com/google/genai/types/AudioTranscriptionConfig.java +++ b/src/main/java/com/google/genai/types/AudioTranscriptionConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -285,6 +286,6 @@ public Builder clearWordTimestamp() { /** Deserializes a JSON string to a AudioTranscriptionConfig object. */ @ExcludeFromGeneratedCoverageReport public static AudioTranscriptionConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AudioTranscriptionConfig.class); + return Common.fromJsonString(jsonString, AudioTranscriptionConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthConfig.java b/src/main/java/com/google/genai/types/AuthConfig.java index 82c66ea34e2..47bab1263c0 100644 --- a/src/main/java/com/google/genai/types/AuthConfig.java +++ b/src/main/java/com/google/genai/types/AuthConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -287,6 +288,6 @@ public Builder clearOidcConfig() { /** Deserializes a JSON string to a AuthConfig object. */ @ExcludeFromGeneratedCoverageReport public static AuthConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthConfig.class); + return Common.fromJsonString(jsonString, AuthConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthConfigGoogleServiceAccountConfig.java b/src/main/java/com/google/genai/types/AuthConfigGoogleServiceAccountConfig.java index d8b05dd1ac1..887dbb27dc5 100644 --- a/src/main/java/com/google/genai/types/AuthConfigGoogleServiceAccountConfig.java +++ b/src/main/java/com/google/genai/types/AuthConfigGoogleServiceAccountConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -93,6 +94,6 @@ public Builder clearServiceAccount() { /** Deserializes a JSON string to a AuthConfigGoogleServiceAccountConfig object. */ @ExcludeFromGeneratedCoverageReport public static AuthConfigGoogleServiceAccountConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthConfigGoogleServiceAccountConfig.class); + return Common.fromJsonString(jsonString, AuthConfigGoogleServiceAccountConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthConfigHttpBasicAuthConfig.java b/src/main/java/com/google/genai/types/AuthConfigHttpBasicAuthConfig.java index e5a266c7db9..f35c5630d0e 100644 --- a/src/main/java/com/google/genai/types/AuthConfigHttpBasicAuthConfig.java +++ b/src/main/java/com/google/genai/types/AuthConfigHttpBasicAuthConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -89,6 +90,6 @@ public Builder clearCredentialSecret() { /** Deserializes a JSON string to a AuthConfigHttpBasicAuthConfig object. */ @ExcludeFromGeneratedCoverageReport public static AuthConfigHttpBasicAuthConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthConfigHttpBasicAuthConfig.class); + return Common.fromJsonString(jsonString, AuthConfigHttpBasicAuthConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthConfigOauthConfig.java b/src/main/java/com/google/genai/types/AuthConfigOauthConfig.java index 35ce227a30b..10071f21084 100644 --- a/src/main/java/com/google/genai/types/AuthConfigOauthConfig.java +++ b/src/main/java/com/google/genai/types/AuthConfigOauthConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearServiceAccount() { /** Deserializes a JSON string to a AuthConfigOauthConfig object. */ @ExcludeFromGeneratedCoverageReport public static AuthConfigOauthConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthConfigOauthConfig.class); + return Common.fromJsonString(jsonString, AuthConfigOauthConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthConfigOidcConfig.java b/src/main/java/com/google/genai/types/AuthConfigOidcConfig.java index 2572aa1581d..30cc212816e 100644 --- a/src/main/java/com/google/genai/types/AuthConfigOidcConfig.java +++ b/src/main/java/com/google/genai/types/AuthConfigOidcConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -116,6 +117,6 @@ public Builder clearServiceAccount() { /** Deserializes a JSON string to a AuthConfigOidcConfig object. */ @ExcludeFromGeneratedCoverageReport public static AuthConfigOidcConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthConfigOidcConfig.class); + return Common.fromJsonString(jsonString, AuthConfigOidcConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AuthToken.java b/src/main/java/com/google/genai/types/AuthToken.java index f97f6821bac..53fd103d0f9 100644 --- a/src/main/java/com/google/genai/types/AuthToken.java +++ b/src/main/java/com/google/genai/types/AuthToken.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearName() { /** Deserializes a JSON string to a AuthToken object. */ @ExcludeFromGeneratedCoverageReport public static AuthToken fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AuthToken.class); + return Common.fromJsonString(jsonString, AuthToken.class); } } diff --git a/src/main/java/com/google/genai/types/AutomaticActivityDetection.java b/src/main/java/com/google/genai/types/AutomaticActivityDetection.java index 5fee77a7f9b..fe1b39508e2 100644 --- a/src/main/java/com/google/genai/types/AutomaticActivityDetection.java +++ b/src/main/java/com/google/genai/types/AutomaticActivityDetection.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -221,6 +222,6 @@ public Builder clearSilenceDurationMs() { /** Deserializes a JSON string to a AutomaticActivityDetection object. */ @ExcludeFromGeneratedCoverageReport public static AutomaticActivityDetection fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AutomaticActivityDetection.class); + return Common.fromJsonString(jsonString, AutomaticActivityDetection.class); } } diff --git a/src/main/java/com/google/genai/types/AutomaticFunctionCallingConfig.java b/src/main/java/com/google/genai/types/AutomaticFunctionCallingConfig.java index 70a86eb0cab..839a57257bf 100644 --- a/src/main/java/com/google/genai/types/AutomaticFunctionCallingConfig.java +++ b/src/main/java/com/google/genai/types/AutomaticFunctionCallingConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -138,6 +139,6 @@ public Builder clearIgnoreCallHistory() { /** Deserializes a JSON string to a AutomaticFunctionCallingConfig object. */ @ExcludeFromGeneratedCoverageReport public static AutomaticFunctionCallingConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AutomaticFunctionCallingConfig.class); + return Common.fromJsonString(jsonString, AutomaticFunctionCallingConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AutoraterConfig.java b/src/main/java/com/google/genai/types/AutoraterConfig.java index a5c816aba8f..97843c1e8b6 100644 --- a/src/main/java/com/google/genai/types/AutoraterConfig.java +++ b/src/main/java/com/google/genai/types/AutoraterConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -182,6 +183,6 @@ public Builder clearFlipEnabled() { /** Deserializes a JSON string to a AutoraterConfig object. */ @ExcludeFromGeneratedCoverageReport public static AutoraterConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AutoraterConfig.class); + return Common.fromJsonString(jsonString, AutoraterConfig.class); } } diff --git a/src/main/java/com/google/genai/types/AvatarConfig.java b/src/main/java/com/google/genai/types/AvatarConfig.java index e9a6005b216..dc85c294841 100644 --- a/src/main/java/com/google/genai/types/AvatarConfig.java +++ b/src/main/java/com/google/genai/types/AvatarConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -152,6 +153,6 @@ public Builder clearVideoBitrateBps() { /** Deserializes a JSON string to a AvatarConfig object. */ @ExcludeFromGeneratedCoverageReport public static AvatarConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, AvatarConfig.class); + return Common.fromJsonString(jsonString, AvatarConfig.class); } } diff --git a/src/main/java/com/google/genai/types/BatchJob.java b/src/main/java/com/google/genai/types/BatchJob.java index aabeb9dc9a5..d496f92cd7b 100644 --- a/src/main/java/com/google/genai/types/BatchJob.java +++ b/src/main/java/com/google/genai/types/BatchJob.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -427,6 +428,6 @@ public Builder clearOutputInfo() { /** Deserializes a JSON string to a BatchJob object. */ @ExcludeFromGeneratedCoverageReport public static BatchJob fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BatchJob.class); + return Common.fromJsonString(jsonString, BatchJob.class); } } diff --git a/src/main/java/com/google/genai/types/BatchJobDestination.java b/src/main/java/com/google/genai/types/BatchJobDestination.java index fd69e38644d..443f877e0cb 100644 --- a/src/main/java/com/google/genai/types/BatchJobDestination.java +++ b/src/main/java/com/google/genai/types/BatchJobDestination.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -301,6 +302,6 @@ public Builder clearVertexDataset() { /** Deserializes a JSON string to a BatchJobDestination object. */ @ExcludeFromGeneratedCoverageReport public static BatchJobDestination fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BatchJobDestination.class); + return Common.fromJsonString(jsonString, BatchJobDestination.class); } } diff --git a/src/main/java/com/google/genai/types/BatchJobOutputInfo.java b/src/main/java/com/google/genai/types/BatchJobOutputInfo.java index 698ec91022e..8738c5bc522 100644 --- a/src/main/java/com/google/genai/types/BatchJobOutputInfo.java +++ b/src/main/java/com/google/genai/types/BatchJobOutputInfo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -132,6 +133,6 @@ public Builder clearBigqueryOutputTable() { /** Deserializes a JSON string to a BatchJobOutputInfo object. */ @ExcludeFromGeneratedCoverageReport public static BatchJobOutputInfo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BatchJobOutputInfo.class); + return Common.fromJsonString(jsonString, BatchJobOutputInfo.class); } } diff --git a/src/main/java/com/google/genai/types/BatchJobSource.java b/src/main/java/com/google/genai/types/BatchJobSource.java index cfcb82c41cf..b86260c2cc7 100644 --- a/src/main/java/com/google/genai/types/BatchJobSource.java +++ b/src/main/java/com/google/genai/types/BatchJobSource.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -229,6 +230,6 @@ public Builder clearVertexDatasetName() { /** Deserializes a JSON string to a BatchJobSource object. */ @ExcludeFromGeneratedCoverageReport public static BatchJobSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BatchJobSource.class); + return Common.fromJsonString(jsonString, BatchJobSource.class); } } diff --git a/src/main/java/com/google/genai/types/BigQuerySource.java b/src/main/java/com/google/genai/types/BigQuerySource.java index 06eb95f7702..921f8ed671a 100644 --- a/src/main/java/com/google/genai/types/BigQuerySource.java +++ b/src/main/java/com/google/genai/types/BigQuerySource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -80,6 +81,6 @@ public Builder clearInputUri() { /** Deserializes a JSON string to a BigQuerySource object. */ @ExcludeFromGeneratedCoverageReport public static BigQuerySource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BigQuerySource.class); + return Common.fromJsonString(jsonString, BigQuerySource.class); } } diff --git a/src/main/java/com/google/genai/types/BleuMetricValue.java b/src/main/java/com/google/genai/types/BleuMetricValue.java index 695092bb30b..543fdb3bb00 100644 --- a/src/main/java/com/google/genai/types/BleuMetricValue.java +++ b/src/main/java/com/google/genai/types/BleuMetricValue.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a BleuMetricValue object. */ @ExcludeFromGeneratedCoverageReport public static BleuMetricValue fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BleuMetricValue.class); + return Common.fromJsonString(jsonString, BleuMetricValue.class); } } diff --git a/src/main/java/com/google/genai/types/BleuSpec.java b/src/main/java/com/google/genai/types/BleuSpec.java index bed20ecec20..a5da1cf7856 100644 --- a/src/main/java/com/google/genai/types/BleuSpec.java +++ b/src/main/java/com/google/genai/types/BleuSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearUseEffectiveOrder() { /** Deserializes a JSON string to a BleuSpec object. */ @ExcludeFromGeneratedCoverageReport public static BleuSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, BleuSpec.class); + return Common.fromJsonString(jsonString, BleuSpec.class); } } diff --git a/src/main/java/com/google/genai/types/Blob.java b/src/main/java/com/google/genai/types/Blob.java index c8fbbd16aa2..6376c0fbb1f 100644 --- a/src/main/java/com/google/genai/types/Blob.java +++ b/src/main/java/com/google/genai/types/Blob.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -131,6 +132,6 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a Blob object. */ @ExcludeFromGeneratedCoverageReport public static Blob fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Blob.class); + return Common.fromJsonString(jsonString, Blob.class); } } diff --git a/src/main/java/com/google/genai/types/CachedContent.java b/src/main/java/com/google/genai/types/CachedContent.java index 09090b8a5be..182371d5ca8 100644 --- a/src/main/java/com/google/genai/types/CachedContent.java +++ b/src/main/java/com/google/genai/types/CachedContent.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -219,6 +220,6 @@ public Builder clearUsageMetadata() { /** Deserializes a JSON string to a CachedContent object. */ @ExcludeFromGeneratedCoverageReport public static CachedContent fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CachedContent.class); + return Common.fromJsonString(jsonString, CachedContent.class); } } diff --git a/src/main/java/com/google/genai/types/CachedContentUsageMetadata.java b/src/main/java/com/google/genai/types/CachedContentUsageMetadata.java index 2c762cc5bd2..a9fba254615 100644 --- a/src/main/java/com/google/genai/types/CachedContentUsageMetadata.java +++ b/src/main/java/com/google/genai/types/CachedContentUsageMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -166,6 +167,6 @@ public Builder clearVideoDurationSeconds() { /** Deserializes a JSON string to a CachedContentUsageMetadata object. */ @ExcludeFromGeneratedCoverageReport public static CachedContentUsageMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CachedContentUsageMetadata.class); + return Common.fromJsonString(jsonString, CachedContentUsageMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/CancelBatchJobConfig.java b/src/main/java/com/google/genai/types/CancelBatchJobConfig.java index efb10de2771..6b77859bf17 100644 --- a/src/main/java/com/google/genai/types/CancelBatchJobConfig.java +++ b/src/main/java/com/google/genai/types/CancelBatchJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a CancelBatchJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static CancelBatchJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CancelBatchJobConfig.class); + return Common.fromJsonString(jsonString, CancelBatchJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CancelBatchJobParameters.java b/src/main/java/com/google/genai/types/CancelBatchJobParameters.java index 73dc9878d9b..fad7b6deb95 100644 --- a/src/main/java/com/google/genai/types/CancelBatchJobParameters.java +++ b/src/main/java/com/google/genai/types/CancelBatchJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -116,6 +117,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CancelBatchJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static CancelBatchJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CancelBatchJobParameters.class); + return Common.fromJsonString(jsonString, CancelBatchJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CancelTuningJobConfig.java b/src/main/java/com/google/genai/types/CancelTuningJobConfig.java index 7f31314ae68..614a72a619b 100644 --- a/src/main/java/com/google/genai/types/CancelTuningJobConfig.java +++ b/src/main/java/com/google/genai/types/CancelTuningJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a CancelTuningJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static CancelTuningJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CancelTuningJobConfig.class); + return Common.fromJsonString(jsonString, CancelTuningJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CancelTuningJobParameters.java b/src/main/java/com/google/genai/types/CancelTuningJobParameters.java index c8ff1de99ad..a9d9ff38455 100644 --- a/src/main/java/com/google/genai/types/CancelTuningJobParameters.java +++ b/src/main/java/com/google/genai/types/CancelTuningJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CancelTuningJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static CancelTuningJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CancelTuningJobParameters.class); + return Common.fromJsonString(jsonString, CancelTuningJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CancelTuningJobResponse.java b/src/main/java/com/google/genai/types/CancelTuningJobResponse.java index e5bdd3713c3..9c0d165f05c 100644 --- a/src/main/java/com/google/genai/types/CancelTuningJobResponse.java +++ b/src/main/java/com/google/genai/types/CancelTuningJobResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a CancelTuningJobResponse object. */ @ExcludeFromGeneratedCoverageReport public static CancelTuningJobResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CancelTuningJobResponse.class); + return Common.fromJsonString(jsonString, CancelTuningJobResponse.class); } } diff --git a/src/main/java/com/google/genai/types/Candidate.java b/src/main/java/com/google/genai/types/Candidate.java index 2df1ed217ec..fc348a458ff 100644 --- a/src/main/java/com/google/genai/types/Candidate.java +++ b/src/main/java/com/google/genai/types/Candidate.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -435,6 +436,6 @@ public Builder clearUrlContextMetadata() { /** Deserializes a JSON string to a Candidate object. */ @ExcludeFromGeneratedCoverageReport public static Candidate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Candidate.class); + return Common.fromJsonString(jsonString, Candidate.class); } } diff --git a/src/main/java/com/google/genai/types/Checkpoint.java b/src/main/java/com/google/genai/types/Checkpoint.java index 24ae1ddbcd9..2d931451140 100644 --- a/src/main/java/com/google/genai/types/Checkpoint.java +++ b/src/main/java/com/google/genai/types/Checkpoint.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearStep() { /** Deserializes a JSON string to a Checkpoint object. */ @ExcludeFromGeneratedCoverageReport public static Checkpoint fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Checkpoint.class); + return Common.fromJsonString(jsonString, Checkpoint.class); } } diff --git a/src/main/java/com/google/genai/types/ChunkingConfig.java b/src/main/java/com/google/genai/types/ChunkingConfig.java index ea20267ae05..07d0714959f 100644 --- a/src/main/java/com/google/genai/types/ChunkingConfig.java +++ b/src/main/java/com/google/genai/types/ChunkingConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearWhiteSpaceConfig() { /** Deserializes a JSON string to a ChunkingConfig object. */ @ExcludeFromGeneratedCoverageReport public static ChunkingConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ChunkingConfig.class); + return Common.fromJsonString(jsonString, ChunkingConfig.class); } } diff --git a/src/main/java/com/google/genai/types/Citation.java b/src/main/java/com/google/genai/types/Citation.java index 38175b0b581..50d913504ec 100644 --- a/src/main/java/com/google/genai/types/Citation.java +++ b/src/main/java/com/google/genai/types/Citation.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -196,6 +197,6 @@ public Builder clearUri() { /** Deserializes a JSON string to a Citation object. */ @ExcludeFromGeneratedCoverageReport public static Citation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Citation.class); + return Common.fromJsonString(jsonString, Citation.class); } } diff --git a/src/main/java/com/google/genai/types/CitationMetadata.java b/src/main/java/com/google/genai/types/CitationMetadata.java index 18efb797ca1..6f4e527da47 100644 --- a/src/main/java/com/google/genai/types/CitationMetadata.java +++ b/src/main/java/com/google/genai/types/CitationMetadata.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -109,6 +110,6 @@ public Builder clearCitations() { /** Deserializes a JSON string to a CitationMetadata object. */ @ExcludeFromGeneratedCoverageReport public static CitationMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CitationMetadata.class); + return Common.fromJsonString(jsonString, CitationMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/ClientOptions.java b/src/main/java/com/google/genai/types/ClientOptions.java index a680896c2f4..181bd7dcc7c 100644 --- a/src/main/java/com/google/genai/types/ClientOptions.java +++ b/src/main/java/com/google/genai/types/ClientOptions.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; import okhttp3.OkHttpClient; @@ -154,6 +155,6 @@ public Builder clearCustomHttpClient() { /** Deserializes a JSON string to a ClientOptions object. */ @ExcludeFromGeneratedCoverageReport public static ClientOptions fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ClientOptions.class); + return Common.fromJsonString(jsonString, ClientOptions.class); } } diff --git a/src/main/java/com/google/genai/types/CodeExecutionResult.java b/src/main/java/com/google/genai/types/CodeExecutionResult.java index 154aaf14b5a..39b25373ace 100644 --- a/src/main/java/com/google/genai/types/CodeExecutionResult.java +++ b/src/main/java/com/google/genai/types/CodeExecutionResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -149,6 +150,6 @@ public Builder clearId() { /** Deserializes a JSON string to a CodeExecutionResult object. */ @ExcludeFromGeneratedCoverageReport public static CodeExecutionResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CodeExecutionResult.class); + return Common.fromJsonString(jsonString, CodeExecutionResult.class); } } diff --git a/src/main/java/com/google/genai/types/CompletionStats.java b/src/main/java/com/google/genai/types/CompletionStats.java index e505496521c..f5a253d7f7a 100644 --- a/src/main/java/com/google/genai/types/CompletionStats.java +++ b/src/main/java/com/google/genai/types/CompletionStats.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -159,6 +160,6 @@ public Builder clearSuccessfulForecastPointCount() { /** Deserializes a JSON string to a CompletionStats object. */ @ExcludeFromGeneratedCoverageReport public static CompletionStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CompletionStats.class); + return Common.fromJsonString(jsonString, CompletionStats.class); } } diff --git a/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfig.java b/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfig.java index bb266c1766b..7e392b47811 100644 --- a/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfig.java +++ b/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -113,7 +114,6 @@ public Builder clearWeightedRewardConfigs() { /** Deserializes a JSON string to a CompositeReinforcementTuningRewardConfig object. */ @ExcludeFromGeneratedCoverageReport public static CompositeReinforcementTuningRewardConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, CompositeReinforcementTuningRewardConfig.class); + return Common.fromJsonString(jsonString, CompositeReinforcementTuningRewardConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfigWeightedRewardConfig.java b/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfigWeightedRewardConfig.java index 14530898c86..0fc3e65e03b 100644 --- a/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfigWeightedRewardConfig.java +++ b/src/main/java/com/google/genai/types/CompositeReinforcementTuningRewardConfigWeightedRewardConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -124,7 +125,7 @@ public Builder clearWeight() { @ExcludeFromGeneratedCoverageReport public static CompositeReinforcementTuningRewardConfigWeightedRewardConfig fromJson( String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, CompositeReinforcementTuningRewardConfigWeightedRewardConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ComputationBasedMetricSpec.java b/src/main/java/com/google/genai/types/ComputationBasedMetricSpec.java index 9e45a672f20..2126f2d554d 100644 --- a/src/main/java/com/google/genai/types/ComputationBasedMetricSpec.java +++ b/src/main/java/com/google/genai/types/ComputationBasedMetricSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -123,6 +124,6 @@ public Builder clearParameters() { /** Deserializes a JSON string to a ComputationBasedMetricSpec object. */ @ExcludeFromGeneratedCoverageReport public static ComputationBasedMetricSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputationBasedMetricSpec.class); + return Common.fromJsonString(jsonString, ComputationBasedMetricSpec.class); } } diff --git a/src/main/java/com/google/genai/types/ComputeTokensConfig.java b/src/main/java/com/google/genai/types/ComputeTokensConfig.java index 3a4bee91d45..0c303dc5178 100644 --- a/src/main/java/com/google/genai/types/ComputeTokensConfig.java +++ b/src/main/java/com/google/genai/types/ComputeTokensConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a ComputeTokensConfig object. */ @ExcludeFromGeneratedCoverageReport public static ComputeTokensConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputeTokensConfig.class); + return Common.fromJsonString(jsonString, ComputeTokensConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ComputeTokensParameters.java b/src/main/java/com/google/genai/types/ComputeTokensParameters.java index 5455bfc8a21..a1bfb3dee10 100644 --- a/src/main/java/com/google/genai/types/ComputeTokensParameters.java +++ b/src/main/java/com/google/genai/types/ComputeTokensParameters.java @@ -26,6 +26,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ComputeTokensParameters object. */ @ExcludeFromGeneratedCoverageReport public static ComputeTokensParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputeTokensParameters.class); + return Common.fromJsonString(jsonString, ComputeTokensParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ComputeTokensResponse.java b/src/main/java/com/google/genai/types/ComputeTokensResponse.java index 7c4660bb43a..9c881d3c9ca 100644 --- a/src/main/java/com/google/genai/types/ComputeTokensResponse.java +++ b/src/main/java/com/google/genai/types/ComputeTokensResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -145,6 +146,6 @@ public Builder clearTokensInfo() { /** Deserializes a JSON string to a ComputeTokensResponse object. */ @ExcludeFromGeneratedCoverageReport public static ComputeTokensResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputeTokensResponse.class); + return Common.fromJsonString(jsonString, ComputeTokensResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ComputeTokensResult.java b/src/main/java/com/google/genai/types/ComputeTokensResult.java index 893e9647031..ef7cf8b4d71 100644 --- a/src/main/java/com/google/genai/types/ComputeTokensResult.java +++ b/src/main/java/com/google/genai/types/ComputeTokensResult.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -103,6 +104,6 @@ public Builder clearTokensInfo() { /** Deserializes a JSON string to a ComputeTokensResult object. */ @ExcludeFromGeneratedCoverageReport public static ComputeTokensResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputeTokensResult.class); + return Common.fromJsonString(jsonString, ComputeTokensResult.class); } } diff --git a/src/main/java/com/google/genai/types/ComputerUse.java b/src/main/java/com/google/genai/types/ComputerUse.java index 1ecc3da044f..1d47dcc5ab6 100644 --- a/src/main/java/com/google/genai/types/ComputerUse.java +++ b/src/main/java/com/google/genai/types/ComputerUse.java @@ -26,6 +26,7 @@ import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -256,6 +257,6 @@ public Builder disabledSafetyPoliciesFromString(List disabledSafetyPolic /** Deserializes a JSON string to a ComputerUse object. */ @ExcludeFromGeneratedCoverageReport public static ComputerUse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ComputerUse.class); + return Common.fromJsonString(jsonString, ComputerUse.class); } } diff --git a/src/main/java/com/google/genai/types/Content.java b/src/main/java/com/google/genai/types/Content.java index 3107d7a9e08..6c62ebfc844 100644 --- a/src/main/java/com/google/genai/types/Content.java +++ b/src/main/java/com/google/genai/types/Content.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.ArrayList; import java.util.Arrays; @@ -137,7 +138,7 @@ public Builder clearRole() { /** Deserializes a JSON string to a Content object. */ @ExcludeFromGeneratedCoverageReport public static Content fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Content.class); + return Common.fromJsonString(jsonString, Content.class); } private static final Logger logger = Logger.getLogger(Content.class.getName()); diff --git a/src/main/java/com/google/genai/types/ContentEmbedding.java b/src/main/java/com/google/genai/types/ContentEmbedding.java index 30a64578823..de1e4cf5e91 100644 --- a/src/main/java/com/google/genai/types/ContentEmbedding.java +++ b/src/main/java/com/google/genai/types/ContentEmbedding.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -125,6 +126,6 @@ public Builder clearStatistics() { /** Deserializes a JSON string to a ContentEmbedding object. */ @ExcludeFromGeneratedCoverageReport public static ContentEmbedding fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ContentEmbedding.class); + return Common.fromJsonString(jsonString, ContentEmbedding.class); } } diff --git a/src/main/java/com/google/genai/types/ContentEmbeddingStatistics.java b/src/main/java/com/google/genai/types/ContentEmbeddingStatistics.java index f5715912ab6..bdfb90135af 100644 --- a/src/main/java/com/google/genai/types/ContentEmbeddingStatistics.java +++ b/src/main/java/com/google/genai/types/ContentEmbeddingStatistics.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -157,6 +158,6 @@ public Builder clearTokensDetails() { /** Deserializes a JSON string to a ContentEmbeddingStatistics object. */ @ExcludeFromGeneratedCoverageReport public static ContentEmbeddingStatistics fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ContentEmbeddingStatistics.class); + return Common.fromJsonString(jsonString, ContentEmbeddingStatistics.class); } } diff --git a/src/main/java/com/google/genai/types/ContentReferenceImage.java b/src/main/java/com/google/genai/types/ContentReferenceImage.java index a1146eef5ad..2840e4e8728 100644 --- a/src/main/java/com/google/genai/types/ContentReferenceImage.java +++ b/src/main/java/com/google/genai/types/ContentReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -136,7 +137,7 @@ public Builder clearReferenceType() { /** Deserializes a JSON string to a ContentReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static ContentReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ContentReferenceImage.class); + return Common.fromJsonString(jsonString, ContentReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/ContextWindowCompressionConfig.java b/src/main/java/com/google/genai/types/ContextWindowCompressionConfig.java index 5e3e34ffdd3..045877adb50 100644 --- a/src/main/java/com/google/genai/types/ContextWindowCompressionConfig.java +++ b/src/main/java/com/google/genai/types/ContextWindowCompressionConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -114,6 +115,6 @@ public Builder clearSlidingWindow() { /** Deserializes a JSON string to a ContextWindowCompressionConfig object. */ @ExcludeFromGeneratedCoverageReport public static ContextWindowCompressionConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ContextWindowCompressionConfig.class); + return Common.fromJsonString(jsonString, ContextWindowCompressionConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ControlReferenceConfig.java b/src/main/java/com/google/genai/types/ControlReferenceConfig.java index 2f23964105a..7d1fd2168a8 100644 --- a/src/main/java/com/google/genai/types/ControlReferenceConfig.java +++ b/src/main/java/com/google/genai/types/ControlReferenceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -123,6 +124,6 @@ public Builder clearEnableControlImageComputation() { /** Deserializes a JSON string to a ControlReferenceConfig object. */ @ExcludeFromGeneratedCoverageReport public static ControlReferenceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ControlReferenceConfig.class); + return Common.fromJsonString(jsonString, ControlReferenceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ControlReferenceImage.java b/src/main/java/com/google/genai/types/ControlReferenceImage.java index 1d64f101a1b..b0a5fb92a98 100644 --- a/src/main/java/com/google/genai/types/ControlReferenceImage.java +++ b/src/main/java/com/google/genai/types/ControlReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -171,7 +172,7 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ControlReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static ControlReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ControlReferenceImage.class); + return Common.fromJsonString(jsonString, ControlReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/CountTokensConfig.java b/src/main/java/com/google/genai/types/CountTokensConfig.java index b1edda35438..46840f51f6b 100644 --- a/src/main/java/com/google/genai/types/CountTokensConfig.java +++ b/src/main/java/com/google/genai/types/CountTokensConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -210,6 +211,6 @@ public Builder clearGenerationConfig() { /** Deserializes a JSON string to a CountTokensConfig object. */ @ExcludeFromGeneratedCoverageReport public static CountTokensConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CountTokensConfig.class); + return Common.fromJsonString(jsonString, CountTokensConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CountTokensParameters.java b/src/main/java/com/google/genai/types/CountTokensParameters.java index d8302ac50fb..8f23f1cf84d 100644 --- a/src/main/java/com/google/genai/types/CountTokensParameters.java +++ b/src/main/java/com/google/genai/types/CountTokensParameters.java @@ -26,6 +26,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CountTokensParameters object. */ @ExcludeFromGeneratedCoverageReport public static CountTokensParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CountTokensParameters.class); + return Common.fromJsonString(jsonString, CountTokensParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CountTokensResponse.java b/src/main/java/com/google/genai/types/CountTokensResponse.java index 9e0daf42313..cf0f7109db5 100644 --- a/src/main/java/com/google/genai/types/CountTokensResponse.java +++ b/src/main/java/com/google/genai/types/CountTokensResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -131,6 +132,6 @@ public Builder clearCachedContentTokenCount() { /** Deserializes a JSON string to a CountTokensResponse object. */ @ExcludeFromGeneratedCoverageReport public static CountTokensResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CountTokensResponse.class); + return Common.fromJsonString(jsonString, CountTokensResponse.class); } } diff --git a/src/main/java/com/google/genai/types/CountTokensResult.java b/src/main/java/com/google/genai/types/CountTokensResult.java index ae11ba72705..e88a5ce48dc 100644 --- a/src/main/java/com/google/genai/types/CountTokensResult.java +++ b/src/main/java/com/google/genai/types/CountTokensResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearTotalTokens() { /** Deserializes a JSON string to a CountTokensResult object. */ @ExcludeFromGeneratedCoverageReport public static CountTokensResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CountTokensResult.class); + return Common.fromJsonString(jsonString, CountTokensResult.class); } } diff --git a/src/main/java/com/google/genai/types/CreateAuthTokenConfig.java b/src/main/java/com/google/genai/types/CreateAuthTokenConfig.java index 29529e1cadf..ef39e9b5f87 100644 --- a/src/main/java/com/google/genai/types/CreateAuthTokenConfig.java +++ b/src/main/java/com/google/genai/types/CreateAuthTokenConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Arrays; @@ -247,6 +248,6 @@ public Builder clearLockAdditionalFields() { /** Deserializes a JSON string to a CreateAuthTokenConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateAuthTokenConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateAuthTokenConfig.class); + return Common.fromJsonString(jsonString, CreateAuthTokenConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateAuthTokenParameters.java b/src/main/java/com/google/genai/types/CreateAuthTokenParameters.java index 1b7796d1407..2ca9c30abd9 100644 --- a/src/main/java/com/google/genai/types/CreateAuthTokenParameters.java +++ b/src/main/java/com/google/genai/types/CreateAuthTokenParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateAuthTokenParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateAuthTokenParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateAuthTokenParameters.class); + return Common.fromJsonString(jsonString, CreateAuthTokenParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateBatchJobConfig.java b/src/main/java/com/google/genai/types/CreateBatchJobConfig.java index edd0192f135..f7365481312 100644 --- a/src/main/java/com/google/genai/types/CreateBatchJobConfig.java +++ b/src/main/java/com/google/genai/types/CreateBatchJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -179,6 +180,6 @@ public Builder clearWebhookConfig() { /** Deserializes a JSON string to a CreateBatchJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateBatchJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateBatchJobConfig.class); + return Common.fromJsonString(jsonString, CreateBatchJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateBatchJobParameters.java b/src/main/java/com/google/genai/types/CreateBatchJobParameters.java index 83c36265a0d..57482af3941 100644 --- a/src/main/java/com/google/genai/types/CreateBatchJobParameters.java +++ b/src/main/java/com/google/genai/types/CreateBatchJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -147,6 +148,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateBatchJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateBatchJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateBatchJobParameters.class); + return Common.fromJsonString(jsonString, CreateBatchJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateCachedContentConfig.java b/src/main/java/com/google/genai/types/CreateCachedContentConfig.java index 47745664cdf..3039deb30d1 100644 --- a/src/main/java/com/google/genai/types/CreateCachedContentConfig.java +++ b/src/main/java/com/google/genai/types/CreateCachedContentConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.time.Instant; @@ -353,6 +354,6 @@ public Builder clearKmsKeyName() { /** Deserializes a JSON string to a CreateCachedContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateCachedContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateCachedContentConfig.class); + return Common.fromJsonString(jsonString, CreateCachedContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateCachedContentParameters.java b/src/main/java/com/google/genai/types/CreateCachedContentParameters.java index 942eeb4bc05..71b8982eedc 100644 --- a/src/main/java/com/google/genai/types/CreateCachedContentParameters.java +++ b/src/main/java/com/google/genai/types/CreateCachedContentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateCachedContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateCachedContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateCachedContentParameters.class); + return Common.fromJsonString(jsonString, CreateCachedContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobConfig.java b/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobConfig.java index 387f1d7efb7..ecefc7da476 100644 --- a/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobConfig.java +++ b/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearDisplayName() { /** Deserializes a JSON string to a CreateEmbeddingsBatchJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateEmbeddingsBatchJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateEmbeddingsBatchJobConfig.class); + return Common.fromJsonString(jsonString, CreateEmbeddingsBatchJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobParameters.java b/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobParameters.java index 7ea473d8809..efbb240a41f 100644 --- a/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobParameters.java +++ b/src/main/java/com/google/genai/types/CreateEmbeddingsBatchJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -145,6 +146,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateEmbeddingsBatchJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateEmbeddingsBatchJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateEmbeddingsBatchJobParameters.class); + return Common.fromJsonString(jsonString, CreateEmbeddingsBatchJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateFileConfig.java b/src/main/java/com/google/genai/types/CreateFileConfig.java index ab8cb38d89c..8acc60bb65c 100644 --- a/src/main/java/com/google/genai/types/CreateFileConfig.java +++ b/src/main/java/com/google/genai/types/CreateFileConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -109,6 +110,6 @@ public Builder clearShouldReturnHttpResponse() { /** Deserializes a JSON string to a CreateFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateFileConfig.class); + return Common.fromJsonString(jsonString, CreateFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateFileParameters.java b/src/main/java/com/google/genai/types/CreateFileParameters.java index b475909f916..2a9b84faf96 100644 --- a/src/main/java/com/google/genai/types/CreateFileParameters.java +++ b/src/main/java/com/google/genai/types/CreateFileParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -128,6 +129,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateFileParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateFileParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateFileParameters.class); + return Common.fromJsonString(jsonString, CreateFileParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateFileResponse.java b/src/main/java/com/google/genai/types/CreateFileResponse.java index ee801e97974..e388ea6bcb4 100644 --- a/src/main/java/com/google/genai/types/CreateFileResponse.java +++ b/src/main/java/com/google/genai/types/CreateFileResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a CreateFileResponse object. */ @ExcludeFromGeneratedCoverageReport public static CreateFileResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateFileResponse.class); + return Common.fromJsonString(jsonString, CreateFileResponse.class); } } diff --git a/src/main/java/com/google/genai/types/CreateFileSearchStoreConfig.java b/src/main/java/com/google/genai/types/CreateFileSearchStoreConfig.java index f44286d5df7..06bb7a08af5 100644 --- a/src/main/java/com/google/genai/types/CreateFileSearchStoreConfig.java +++ b/src/main/java/com/google/genai/types/CreateFileSearchStoreConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -134,6 +135,6 @@ public Builder clearEmbeddingModel() { /** Deserializes a JSON string to a CreateFileSearchStoreConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateFileSearchStoreConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateFileSearchStoreConfig.class); + return Common.fromJsonString(jsonString, CreateFileSearchStoreConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateFileSearchStoreParameters.java b/src/main/java/com/google/genai/types/CreateFileSearchStoreParameters.java index 31db0434ef7..67593648d06 100644 --- a/src/main/java/com/google/genai/types/CreateFileSearchStoreParameters.java +++ b/src/main/java/com/google/genai/types/CreateFileSearchStoreParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -90,6 +91,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateFileSearchStoreParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateFileSearchStoreParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateFileSearchStoreParameters.class); + return Common.fromJsonString(jsonString, CreateFileSearchStoreParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateTuningJobConfig.java b/src/main/java/com/google/genai/types/CreateTuningJobConfig.java index 09b3c6adc66..c0666fd4d81 100644 --- a/src/main/java/com/google/genai/types/CreateTuningJobConfig.java +++ b/src/main/java/com/google/genai/types/CreateTuningJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -937,6 +938,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a CreateTuningJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static CreateTuningJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateTuningJobConfig.class); + return Common.fromJsonString(jsonString, CreateTuningJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CreateTuningJobParameters.java b/src/main/java/com/google/genai/types/CreateTuningJobParameters.java index f0f49ddfef1..0045f449403 100644 --- a/src/main/java/com/google/genai/types/CreateTuningJobParameters.java +++ b/src/main/java/com/google/genai/types/CreateTuningJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -147,6 +148,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateTuningJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static CreateTuningJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateTuningJobParameters.class); + return Common.fromJsonString(jsonString, CreateTuningJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/CreateTuningJobParametersPrivate.java b/src/main/java/com/google/genai/types/CreateTuningJobParametersPrivate.java index 68ee15ace01..e8f36fb2db5 100644 --- a/src/main/java/com/google/genai/types/CreateTuningJobParametersPrivate.java +++ b/src/main/java/com/google/genai/types/CreateTuningJobParametersPrivate.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -182,6 +183,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a CreateTuningJobParametersPrivate object. */ @ExcludeFromGeneratedCoverageReport public static CreateTuningJobParametersPrivate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CreateTuningJobParametersPrivate.class); + return Common.fromJsonString(jsonString, CreateTuningJobParametersPrivate.class); } } diff --git a/src/main/java/com/google/genai/types/CustomCodeExecutionResult.java b/src/main/java/com/google/genai/types/CustomCodeExecutionResult.java index f3a740e13e5..f5c1679106d 100644 --- a/src/main/java/com/google/genai/types/CustomCodeExecutionResult.java +++ b/src/main/java/com/google/genai/types/CustomCodeExecutionResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a CustomCodeExecutionResult object. */ @ExcludeFromGeneratedCoverageReport public static CustomCodeExecutionResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomCodeExecutionResult.class); + return Common.fromJsonString(jsonString, CustomCodeExecutionResult.class); } } diff --git a/src/main/java/com/google/genai/types/CustomCodeExecutionSpec.java b/src/main/java/com/google/genai/types/CustomCodeExecutionSpec.java index 4fc011d1d23..086d6c21660 100644 --- a/src/main/java/com/google/genai/types/CustomCodeExecutionSpec.java +++ b/src/main/java/com/google/genai/types/CustomCodeExecutionSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -85,6 +86,6 @@ public Builder clearEvaluationFunction() { /** Deserializes a JSON string to a CustomCodeExecutionSpec object. */ @ExcludeFromGeneratedCoverageReport public static CustomCodeExecutionSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomCodeExecutionSpec.class); + return Common.fromJsonString(jsonString, CustomCodeExecutionSpec.class); } } diff --git a/src/main/java/com/google/genai/types/CustomMetadata.java b/src/main/java/com/google/genai/types/CustomMetadata.java index 1e34b3bcc1d..daa3e14b81d 100644 --- a/src/main/java/com/google/genai/types/CustomMetadata.java +++ b/src/main/java/com/google/genai/types/CustomMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -154,6 +155,6 @@ public Builder clearStringValue() { /** Deserializes a JSON string to a CustomMetadata object. */ @ExcludeFromGeneratedCoverageReport public static CustomMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomMetadata.class); + return Common.fromJsonString(jsonString, CustomMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/CustomOutput.java b/src/main/java/com/google/genai/types/CustomOutput.java index 6ab960e0dc9..f18282c82fa 100644 --- a/src/main/java/com/google/genai/types/CustomOutput.java +++ b/src/main/java/com/google/genai/types/CustomOutput.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearRawOutputs() { /** Deserializes a JSON string to a CustomOutput object. */ @ExcludeFromGeneratedCoverageReport public static CustomOutput fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomOutput.class); + return Common.fromJsonString(jsonString, CustomOutput.class); } } diff --git a/src/main/java/com/google/genai/types/CustomOutputFormatConfig.java b/src/main/java/com/google/genai/types/CustomOutputFormatConfig.java index ea17ac88036..1932922f7c8 100644 --- a/src/main/java/com/google/genai/types/CustomOutputFormatConfig.java +++ b/src/main/java/com/google/genai/types/CustomOutputFormatConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearReturnRawOutput() { /** Deserializes a JSON string to a CustomOutputFormatConfig object. */ @ExcludeFromGeneratedCoverageReport public static CustomOutputFormatConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomOutputFormatConfig.class); + return Common.fromJsonString(jsonString, CustomOutputFormatConfig.class); } } diff --git a/src/main/java/com/google/genai/types/CustomizedAvatar.java b/src/main/java/com/google/genai/types/CustomizedAvatar.java index 20d72a7be32..9f7d266240a 100644 --- a/src/main/java/com/google/genai/types/CustomizedAvatar.java +++ b/src/main/java/com/google/genai/types/CustomizedAvatar.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -102,6 +103,6 @@ public Builder clearImageData() { /** Deserializes a JSON string to a CustomizedAvatar object. */ @ExcludeFromGeneratedCoverageReport public static CustomizedAvatar fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, CustomizedAvatar.class); + return Common.fromJsonString(jsonString, CustomizedAvatar.class); } } diff --git a/src/main/java/com/google/genai/types/DatasetDistribution.java b/src/main/java/com/google/genai/types/DatasetDistribution.java index 2b38c042014..299f7da55b0 100644 --- a/src/main/java/com/google/genai/types/DatasetDistribution.java +++ b/src/main/java/com/google/genai/types/DatasetDistribution.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -257,6 +258,6 @@ public Builder clearSum() { /** Deserializes a JSON string to a DatasetDistribution object. */ @ExcludeFromGeneratedCoverageReport public static DatasetDistribution fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DatasetDistribution.class); + return Common.fromJsonString(jsonString, DatasetDistribution.class); } } diff --git a/src/main/java/com/google/genai/types/DatasetDistributionDistributionBucket.java b/src/main/java/com/google/genai/types/DatasetDistributionDistributionBucket.java index c4e278404a3..d9bdba46a5d 100644 --- a/src/main/java/com/google/genai/types/DatasetDistributionDistributionBucket.java +++ b/src/main/java/com/google/genai/types/DatasetDistributionDistributionBucket.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -126,6 +127,6 @@ public Builder clearRight() { /** Deserializes a JSON string to a DatasetDistributionDistributionBucket object. */ @ExcludeFromGeneratedCoverageReport public static DatasetDistributionDistributionBucket fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DatasetDistributionDistributionBucket.class); + return Common.fromJsonString(jsonString, DatasetDistributionDistributionBucket.class); } } diff --git a/src/main/java/com/google/genai/types/DatasetStats.java b/src/main/java/com/google/genai/types/DatasetStats.java index 905965486fd..83dea7936cb 100644 --- a/src/main/java/com/google/genai/types/DatasetStats.java +++ b/src/main/java/com/google/genai/types/DatasetStats.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -473,6 +474,6 @@ public Builder clearTotalBillableTokenCount() { /** Deserializes a JSON string to a DatasetStats object. */ @ExcludeFromGeneratedCoverageReport public static DatasetStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DatasetStats.class); + return Common.fromJsonString(jsonString, DatasetStats.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteBatchJobConfig.java b/src/main/java/com/google/genai/types/DeleteBatchJobConfig.java index e6ee9375d71..cd1c5d845c6 100644 --- a/src/main/java/com/google/genai/types/DeleteBatchJobConfig.java +++ b/src/main/java/com/google/genai/types/DeleteBatchJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DeleteBatchJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteBatchJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteBatchJobConfig.class); + return Common.fromJsonString(jsonString, DeleteBatchJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteBatchJobParameters.java b/src/main/java/com/google/genai/types/DeleteBatchJobParameters.java index 925d2dfc6b7..42767158f45 100644 --- a/src/main/java/com/google/genai/types/DeleteBatchJobParameters.java +++ b/src/main/java/com/google/genai/types/DeleteBatchJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -116,6 +117,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteBatchJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteBatchJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteBatchJobParameters.class); + return Common.fromJsonString(jsonString, DeleteBatchJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteCachedContentConfig.java b/src/main/java/com/google/genai/types/DeleteCachedContentConfig.java index 97bbea600bd..9455e8813df 100644 --- a/src/main/java/com/google/genai/types/DeleteCachedContentConfig.java +++ b/src/main/java/com/google/genai/types/DeleteCachedContentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DeleteCachedContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteCachedContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteCachedContentConfig.class); + return Common.fromJsonString(jsonString, DeleteCachedContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteCachedContentParameters.java b/src/main/java/com/google/genai/types/DeleteCachedContentParameters.java index 39058b16c8b..5d3c91cb40a 100644 --- a/src/main/java/com/google/genai/types/DeleteCachedContentParameters.java +++ b/src/main/java/com/google/genai/types/DeleteCachedContentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteCachedContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteCachedContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteCachedContentParameters.class); + return Common.fromJsonString(jsonString, DeleteCachedContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteCachedContentResponse.java b/src/main/java/com/google/genai/types/DeleteCachedContentResponse.java index 35c4d076dc2..800a471936e 100644 --- a/src/main/java/com/google/genai/types/DeleteCachedContentResponse.java +++ b/src/main/java/com/google/genai/types/DeleteCachedContentResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a DeleteCachedContentResponse object. */ @ExcludeFromGeneratedCoverageReport public static DeleteCachedContentResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteCachedContentResponse.class); + return Common.fromJsonString(jsonString, DeleteCachedContentResponse.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteDocumentConfig.java b/src/main/java/com/google/genai/types/DeleteDocumentConfig.java index 306dd850675..f0a9b37368d 100644 --- a/src/main/java/com/google/genai/types/DeleteDocumentConfig.java +++ b/src/main/java/com/google/genai/types/DeleteDocumentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -109,6 +110,6 @@ public Builder clearForce() { /** Deserializes a JSON string to a DeleteDocumentConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteDocumentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteDocumentConfig.class); + return Common.fromJsonString(jsonString, DeleteDocumentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteDocumentParameters.java b/src/main/java/com/google/genai/types/DeleteDocumentParameters.java index b68736d6ea4..c34d2b5b2a6 100644 --- a/src/main/java/com/google/genai/types/DeleteDocumentParameters.java +++ b/src/main/java/com/google/genai/types/DeleteDocumentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -114,6 +115,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteDocumentParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteDocumentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteDocumentParameters.class); + return Common.fromJsonString(jsonString, DeleteDocumentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteFileConfig.java b/src/main/java/com/google/genai/types/DeleteFileConfig.java index f1d4df1ad48..98094e2d2a5 100644 --- a/src/main/java/com/google/genai/types/DeleteFileConfig.java +++ b/src/main/java/com/google/genai/types/DeleteFileConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DeleteFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteFileConfig.class); + return Common.fromJsonString(jsonString, DeleteFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteFileParameters.java b/src/main/java/com/google/genai/types/DeleteFileParameters.java index a4ab714f297..e6d95b2172d 100644 --- a/src/main/java/com/google/genai/types/DeleteFileParameters.java +++ b/src/main/java/com/google/genai/types/DeleteFileParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteFileParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteFileParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteFileParameters.class); + return Common.fromJsonString(jsonString, DeleteFileParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteFileResponse.java b/src/main/java/com/google/genai/types/DeleteFileResponse.java index 9fdf155a1f1..caec424bd57 100644 --- a/src/main/java/com/google/genai/types/DeleteFileResponse.java +++ b/src/main/java/com/google/genai/types/DeleteFileResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a DeleteFileResponse object. */ @ExcludeFromGeneratedCoverageReport public static DeleteFileResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteFileResponse.class); + return Common.fromJsonString(jsonString, DeleteFileResponse.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteFileSearchStoreConfig.java b/src/main/java/com/google/genai/types/DeleteFileSearchStoreConfig.java index 0ad4f6b73a7..7e4896aa060 100644 --- a/src/main/java/com/google/genai/types/DeleteFileSearchStoreConfig.java +++ b/src/main/java/com/google/genai/types/DeleteFileSearchStoreConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -114,6 +115,6 @@ public Builder clearForce() { /** Deserializes a JSON string to a DeleteFileSearchStoreConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteFileSearchStoreConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteFileSearchStoreConfig.class); + return Common.fromJsonString(jsonString, DeleteFileSearchStoreConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteFileSearchStoreParameters.java b/src/main/java/com/google/genai/types/DeleteFileSearchStoreParameters.java index e04ca3f4a66..01fba83acc7 100644 --- a/src/main/java/com/google/genai/types/DeleteFileSearchStoreParameters.java +++ b/src/main/java/com/google/genai/types/DeleteFileSearchStoreParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -115,6 +116,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteFileSearchStoreParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteFileSearchStoreParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteFileSearchStoreParameters.class); + return Common.fromJsonString(jsonString, DeleteFileSearchStoreParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteModelConfig.java b/src/main/java/com/google/genai/types/DeleteModelConfig.java index 71dfb03674c..9ac33439ef6 100644 --- a/src/main/java/com/google/genai/types/DeleteModelConfig.java +++ b/src/main/java/com/google/genai/types/DeleteModelConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DeleteModelConfig object. */ @ExcludeFromGeneratedCoverageReport public static DeleteModelConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteModelConfig.class); + return Common.fromJsonString(jsonString, DeleteModelConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteModelParameters.java b/src/main/java/com/google/genai/types/DeleteModelParameters.java index 82fa2ae2b8f..31e5b3fea20 100644 --- a/src/main/java/com/google/genai/types/DeleteModelParameters.java +++ b/src/main/java/com/google/genai/types/DeleteModelParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a DeleteModelParameters object. */ @ExcludeFromGeneratedCoverageReport public static DeleteModelParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteModelParameters.class); + return Common.fromJsonString(jsonString, DeleteModelParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteModelResponse.java b/src/main/java/com/google/genai/types/DeleteModelResponse.java index 153eb37b726..e044e1c07e9 100644 --- a/src/main/java/com/google/genai/types/DeleteModelResponse.java +++ b/src/main/java/com/google/genai/types/DeleteModelResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a DeleteModelResponse object. */ @ExcludeFromGeneratedCoverageReport public static DeleteModelResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteModelResponse.class); + return Common.fromJsonString(jsonString, DeleteModelResponse.class); } } diff --git a/src/main/java/com/google/genai/types/DeleteResourceJob.java b/src/main/java/com/google/genai/types/DeleteResourceJob.java index 73f6cc6acf7..7d3d8d79618 100644 --- a/src/main/java/com/google/genai/types/DeleteResourceJob.java +++ b/src/main/java/com/google/genai/types/DeleteResourceJob.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -162,6 +163,6 @@ public Builder clearError() { /** Deserializes a JSON string to a DeleteResourceJob object. */ @ExcludeFromGeneratedCoverageReport public static DeleteResourceJob fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DeleteResourceJob.class); + return Common.fromJsonString(jsonString, DeleteResourceJob.class); } } diff --git a/src/main/java/com/google/genai/types/DistillationDataStats.java b/src/main/java/com/google/genai/types/DistillationDataStats.java index 719a491e653..36b7fe6689f 100644 --- a/src/main/java/com/google/genai/types/DistillationDataStats.java +++ b/src/main/java/com/google/genai/types/DistillationDataStats.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -89,6 +90,6 @@ public Builder clearTrainingDatasetStats() { /** Deserializes a JSON string to a DistillationDataStats object. */ @ExcludeFromGeneratedCoverageReport public static DistillationDataStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DistillationDataStats.class); + return Common.fromJsonString(jsonString, DistillationDataStats.class); } } diff --git a/src/main/java/com/google/genai/types/DistillationHyperParameters.java b/src/main/java/com/google/genai/types/DistillationHyperParameters.java index cd4ad941f34..cf3f254998b 100644 --- a/src/main/java/com/google/genai/types/DistillationHyperParameters.java +++ b/src/main/java/com/google/genai/types/DistillationHyperParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -227,6 +228,6 @@ public Builder clearBatchSize() { /** Deserializes a JSON string to a DistillationHyperParameters object. */ @ExcludeFromGeneratedCoverageReport public static DistillationHyperParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DistillationHyperParameters.class); + return Common.fromJsonString(jsonString, DistillationHyperParameters.class); } } diff --git a/src/main/java/com/google/genai/types/DistillationSamplingSpec.java b/src/main/java/com/google/genai/types/DistillationSamplingSpec.java index 74d7057dd30..aac04168c6c 100644 --- a/src/main/java/com/google/genai/types/DistillationSamplingSpec.java +++ b/src/main/java/com/google/genai/types/DistillationSamplingSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -190,6 +191,6 @@ public Builder clearHyperparameters() { /** Deserializes a JSON string to a DistillationSamplingSpec object. */ @ExcludeFromGeneratedCoverageReport public static DistillationSamplingSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DistillationSamplingSpec.class); + return Common.fromJsonString(jsonString, DistillationSamplingSpec.class); } } diff --git a/src/main/java/com/google/genai/types/DistillationSpec.java b/src/main/java/com/google/genai/types/DistillationSpec.java index 9f55b8f88aa..f9d31dc7b6c 100644 --- a/src/main/java/com/google/genai/types/DistillationSpec.java +++ b/src/main/java/com/google/genai/types/DistillationSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -318,6 +319,6 @@ public Builder tuningMode(String tuningMode) { /** Deserializes a JSON string to a DistillationSpec object. */ @ExcludeFromGeneratedCoverageReport public static DistillationSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DistillationSpec.class); + return Common.fromJsonString(jsonString, DistillationSpec.class); } } diff --git a/src/main/java/com/google/genai/types/Document.java b/src/main/java/com/google/genai/types/Document.java index 0f309fb657b..4ae35090bb0 100644 --- a/src/main/java/com/google/genai/types/Document.java +++ b/src/main/java/com/google/genai/types/Document.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Arrays; @@ -301,6 +302,6 @@ public Builder clearUpdateTime() { /** Deserializes a JSON string to a Document object. */ @ExcludeFromGeneratedCoverageReport public static Document fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Document.class); + return Common.fromJsonString(jsonString, Document.class); } } diff --git a/src/main/java/com/google/genai/types/DownloadFileConfig.java b/src/main/java/com/google/genai/types/DownloadFileConfig.java index c73a6e69b71..83052893a86 100644 --- a/src/main/java/com/google/genai/types/DownloadFileConfig.java +++ b/src/main/java/com/google/genai/types/DownloadFileConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DownloadFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static DownloadFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DownloadFileConfig.class); + return Common.fromJsonString(jsonString, DownloadFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DownloadMediaConfig.java b/src/main/java/com/google/genai/types/DownloadMediaConfig.java index 5b1a7abb52e..ae39aed5335 100644 --- a/src/main/java/com/google/genai/types/DownloadMediaConfig.java +++ b/src/main/java/com/google/genai/types/DownloadMediaConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a DownloadMediaConfig object. */ @ExcludeFromGeneratedCoverageReport public static DownloadMediaConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DownloadMediaConfig.class); + return Common.fromJsonString(jsonString, DownloadMediaConfig.class); } } diff --git a/src/main/java/com/google/genai/types/DynamicRetrievalConfig.java b/src/main/java/com/google/genai/types/DynamicRetrievalConfig.java index f8a2953a540..957a35cd7e7 100644 --- a/src/main/java/com/google/genai/types/DynamicRetrievalConfig.java +++ b/src/main/java/com/google/genai/types/DynamicRetrievalConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -122,6 +123,6 @@ public Builder mode(String mode) { /** Deserializes a JSON string to a DynamicRetrievalConfig object. */ @ExcludeFromGeneratedCoverageReport public static DynamicRetrievalConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, DynamicRetrievalConfig.class); + return Common.fromJsonString(jsonString, DynamicRetrievalConfig.class); } } diff --git a/src/main/java/com/google/genai/types/EditImageConfig.java b/src/main/java/com/google/genai/types/EditImageConfig.java index df850235ed3..050a7333c89 100644 --- a/src/main/java/com/google/genai/types/EditImageConfig.java +++ b/src/main/java/com/google/genai/types/EditImageConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -565,6 +566,6 @@ public Builder clearBaseSteps() { /** Deserializes a JSON string to a EditImageConfig object. */ @ExcludeFromGeneratedCoverageReport public static EditImageConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EditImageConfig.class); + return Common.fromJsonString(jsonString, EditImageConfig.class); } } diff --git a/src/main/java/com/google/genai/types/EditImageParameters.java b/src/main/java/com/google/genai/types/EditImageParameters.java index c9a5c79353d..daeec6f0614 100644 --- a/src/main/java/com/google/genai/types/EditImageParameters.java +++ b/src/main/java/com/google/genai/types/EditImageParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -166,6 +167,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a EditImageParameters object. */ @ExcludeFromGeneratedCoverageReport public static EditImageParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EditImageParameters.class); + return Common.fromJsonString(jsonString, EditImageParameters.class); } } diff --git a/src/main/java/com/google/genai/types/EditImageResponse.java b/src/main/java/com/google/genai/types/EditImageResponse.java index 3c7671c0968..685d0f03925 100644 --- a/src/main/java/com/google/genai/types/EditImageResponse.java +++ b/src/main/java/com/google/genai/types/EditImageResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -135,6 +136,6 @@ public Builder clearGeneratedImages() { /** Deserializes a JSON string to a EditImageResponse object. */ @ExcludeFromGeneratedCoverageReport public static EditImageResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EditImageResponse.class); + return Common.fromJsonString(jsonString, EditImageResponse.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentBatch.java b/src/main/java/com/google/genai/types/EmbedContentBatch.java index 191b16c1637..a079cdb863c 100644 --- a/src/main/java/com/google/genai/types/EmbedContentBatch.java +++ b/src/main/java/com/google/genai/types/EmbedContentBatch.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -135,6 +136,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a EmbedContentBatch object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentBatch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentBatch.class); + return Common.fromJsonString(jsonString, EmbedContentBatch.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentConfig.java b/src/main/java/com/google/genai/types/EmbedContentConfig.java index 2a600f22aec..c2b60001a18 100644 --- a/src/main/java/com/google/genai/types/EmbedContentConfig.java +++ b/src/main/java/com/google/genai/types/EmbedContentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -260,6 +261,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a EmbedContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentConfig.class); + return Common.fromJsonString(jsonString, EmbedContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentMetadata.java b/src/main/java/com/google/genai/types/EmbedContentMetadata.java index 959308828df..fe5436384ac 100644 --- a/src/main/java/com/google/genai/types/EmbedContentMetadata.java +++ b/src/main/java/com/google/genai/types/EmbedContentMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -80,6 +81,6 @@ public Builder clearBillableCharacterCount() { /** Deserializes a JSON string to a EmbedContentMetadata object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentMetadata.class); + return Common.fromJsonString(jsonString, EmbedContentMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentParameters.java b/src/main/java/com/google/genai/types/EmbedContentParameters.java index 3ab041cadd7..e9140e7c0c5 100644 --- a/src/main/java/com/google/genai/types/EmbedContentParameters.java +++ b/src/main/java/com/google/genai/types/EmbedContentParameters.java @@ -26,6 +26,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a EmbedContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentParameters.class); + return Common.fromJsonString(jsonString, EmbedContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentParametersPrivate.java b/src/main/java/com/google/genai/types/EmbedContentParametersPrivate.java index 699b4d5713a..0f71554ffbc 100644 --- a/src/main/java/com/google/genai/types/EmbedContentParametersPrivate.java +++ b/src/main/java/com/google/genai/types/EmbedContentParametersPrivate.java @@ -26,6 +26,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -239,6 +240,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a EmbedContentParametersPrivate object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentParametersPrivate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentParametersPrivate.class); + return Common.fromJsonString(jsonString, EmbedContentParametersPrivate.class); } } diff --git a/src/main/java/com/google/genai/types/EmbedContentResponse.java b/src/main/java/com/google/genai/types/EmbedContentResponse.java index 91fba94e507..24ea5aaf3c8 100644 --- a/src/main/java/com/google/genai/types/EmbedContentResponse.java +++ b/src/main/java/com/google/genai/types/EmbedContentResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -170,6 +171,6 @@ public Builder clearMetadata() { /** Deserializes a JSON string to a EmbedContentResponse object. */ @ExcludeFromGeneratedCoverageReport public static EmbedContentResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbedContentResponse.class); + return Common.fromJsonString(jsonString, EmbedContentResponse.class); } } diff --git a/src/main/java/com/google/genai/types/EmbeddingsBatchJobSource.java b/src/main/java/com/google/genai/types/EmbeddingsBatchJobSource.java index 55d6326585c..a33d14053c2 100644 --- a/src/main/java/com/google/genai/types/EmbeddingsBatchJobSource.java +++ b/src/main/java/com/google/genai/types/EmbeddingsBatchJobSource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -109,6 +110,6 @@ public Builder clearInlinedRequests() { /** Deserializes a JSON string to a EmbeddingsBatchJobSource object. */ @ExcludeFromGeneratedCoverageReport public static EmbeddingsBatchJobSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EmbeddingsBatchJobSource.class); + return Common.fromJsonString(jsonString, EmbeddingsBatchJobSource.class); } } diff --git a/src/main/java/com/google/genai/types/EncryptionSpec.java b/src/main/java/com/google/genai/types/EncryptionSpec.java index 947f7b26303..ed573a9b63d 100644 --- a/src/main/java/com/google/genai/types/EncryptionSpec.java +++ b/src/main/java/com/google/genai/types/EncryptionSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -85,6 +86,6 @@ public Builder clearKmsKeyName() { /** Deserializes a JSON string to a EncryptionSpec object. */ @ExcludeFromGeneratedCoverageReport public static EncryptionSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EncryptionSpec.class); + return Common.fromJsonString(jsonString, EncryptionSpec.class); } } diff --git a/src/main/java/com/google/genai/types/Endpoint.java b/src/main/java/com/google/genai/types/Endpoint.java index 66ec39d54b6..86c3a379f13 100644 --- a/src/main/java/com/google/genai/types/Endpoint.java +++ b/src/main/java/com/google/genai/types/Endpoint.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder clearDeployedModelId() { /** Deserializes a JSON string to a Endpoint object. */ @ExcludeFromGeneratedCoverageReport public static Endpoint fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Endpoint.class); + return Common.fromJsonString(jsonString, Endpoint.class); } } diff --git a/src/main/java/com/google/genai/types/EnterpriseWebSearch.java b/src/main/java/com/google/genai/types/EnterpriseWebSearch.java index d198d0703c7..48c656ff0cd 100644 --- a/src/main/java/com/google/genai/types/EnterpriseWebSearch.java +++ b/src/main/java/com/google/genai/types/EnterpriseWebSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -144,6 +145,6 @@ public Builder clearExcludeDomains() { /** Deserializes a JSON string to a EnterpriseWebSearch object. */ @ExcludeFromGeneratedCoverageReport public static EnterpriseWebSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EnterpriseWebSearch.class); + return Common.fromJsonString(jsonString, EnterpriseWebSearch.class); } } diff --git a/src/main/java/com/google/genai/types/EntityLabel.java b/src/main/java/com/google/genai/types/EntityLabel.java index 533708a1f80..e4570a01d44 100644 --- a/src/main/java/com/google/genai/types/EntityLabel.java +++ b/src/main/java/com/google/genai/types/EntityLabel.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a EntityLabel object. */ @ExcludeFromGeneratedCoverageReport public static EntityLabel fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EntityLabel.class); + return Common.fromJsonString(jsonString, EntityLabel.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluateDatasetResponse.java b/src/main/java/com/google/genai/types/EvaluateDatasetResponse.java index 75fa4c58ec8..50d99c4475b 100644 --- a/src/main/java/com/google/genai/types/EvaluateDatasetResponse.java +++ b/src/main/java/com/google/genai/types/EvaluateDatasetResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -123,6 +124,6 @@ public Builder clearOutputInfo() { /** Deserializes a JSON string to a EvaluateDatasetResponse object. */ @ExcludeFromGeneratedCoverageReport public static EvaluateDatasetResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EvaluateDatasetResponse.class); + return Common.fromJsonString(jsonString, EvaluateDatasetResponse.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluateDatasetRun.java b/src/main/java/com/google/genai/types/EvaluateDatasetRun.java index a0fadae278e..e2b252ba4dc 100644 --- a/src/main/java/com/google/genai/types/EvaluateDatasetRun.java +++ b/src/main/java/com/google/genai/types/EvaluateDatasetRun.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -196,6 +197,6 @@ public Builder clearOperationName() { /** Deserializes a JSON string to a EvaluateDatasetRun object. */ @ExcludeFromGeneratedCoverageReport public static EvaluateDatasetRun fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EvaluateDatasetRun.class); + return Common.fromJsonString(jsonString, EvaluateDatasetRun.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluationConfig.java b/src/main/java/com/google/genai/types/EvaluationConfig.java index 3e452209de8..44bfea6a6a9 100644 --- a/src/main/java/com/google/genai/types/EvaluationConfig.java +++ b/src/main/java/com/google/genai/types/EvaluationConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -201,6 +202,6 @@ public Builder clearInferenceGenerationConfig() { /** Deserializes a JSON string to a EvaluationConfig object. */ @ExcludeFromGeneratedCoverageReport public static EvaluationConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EvaluationConfig.class); + return Common.fromJsonString(jsonString, EvaluationConfig.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluationDataset.java b/src/main/java/com/google/genai/types/EvaluationDataset.java index 4d9cf7d35a6..ceb0f7fade8 100644 --- a/src/main/java/com/google/genai/types/EvaluationDataset.java +++ b/src/main/java/com/google/genai/types/EvaluationDataset.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -123,6 +124,6 @@ public Builder clearGcsSource() { /** Deserializes a JSON string to a EvaluationDataset object. */ @ExcludeFromGeneratedCoverageReport public static EvaluationDataset fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EvaluationDataset.class); + return Common.fromJsonString(jsonString, EvaluationDataset.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluationParserConfig.java b/src/main/java/com/google/genai/types/EvaluationParserConfig.java index 15ef3c31b85..2690ca1cded 100644 --- a/src/main/java/com/google/genai/types/EvaluationParserConfig.java +++ b/src/main/java/com/google/genai/types/EvaluationParserConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -93,6 +94,6 @@ public Builder clearCustomCodeParserConfig() { /** Deserializes a JSON string to a EvaluationParserConfig object. */ @ExcludeFromGeneratedCoverageReport public static EvaluationParserConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, EvaluationParserConfig.class); + return Common.fromJsonString(jsonString, EvaluationParserConfig.class); } } diff --git a/src/main/java/com/google/genai/types/EvaluationParserConfigCustomCodeParserConfig.java b/src/main/java/com/google/genai/types/EvaluationParserConfigCustomCodeParserConfig.java index 733de9d1230..58108e4c09a 100644 --- a/src/main/java/com/google/genai/types/EvaluationParserConfigCustomCodeParserConfig.java +++ b/src/main/java/com/google/genai/types/EvaluationParserConfigCustomCodeParserConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -105,7 +106,6 @@ public Builder clearParsingFunction() { /** Deserializes a JSON string to a EvaluationParserConfigCustomCodeParserConfig object. */ @ExcludeFromGeneratedCoverageReport public static EvaluationParserConfigCustomCodeParserConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, EvaluationParserConfigCustomCodeParserConfig.class); + return Common.fromJsonString(jsonString, EvaluationParserConfigCustomCodeParserConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ExactMatchMetricValue.java b/src/main/java/com/google/genai/types/ExactMatchMetricValue.java index 7a241f2ba46..c666cd2d13f 100644 --- a/src/main/java/com/google/genai/types/ExactMatchMetricValue.java +++ b/src/main/java/com/google/genai/types/ExactMatchMetricValue.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a ExactMatchMetricValue object. */ @ExcludeFromGeneratedCoverageReport public static ExactMatchMetricValue fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ExactMatchMetricValue.class); + return Common.fromJsonString(jsonString, ExactMatchMetricValue.class); } } diff --git a/src/main/java/com/google/genai/types/ExecutableCode.java b/src/main/java/com/google/genai/types/ExecutableCode.java index f28d0506cd8..d9fa4e174ad 100644 --- a/src/main/java/com/google/genai/types/ExecutableCode.java +++ b/src/main/java/com/google/genai/types/ExecutableCode.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -148,6 +149,6 @@ public Builder clearId() { /** Deserializes a JSON string to a ExecutableCode object. */ @ExcludeFromGeneratedCoverageReport public static ExecutableCode fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ExecutableCode.class); + return Common.fromJsonString(jsonString, ExecutableCode.class); } } diff --git a/src/main/java/com/google/genai/types/ExternalApi.java b/src/main/java/com/google/genai/types/ExternalApi.java index d06f51707e0..8060d55c65f 100644 --- a/src/main/java/com/google/genai/types/ExternalApi.java +++ b/src/main/java/com/google/genai/types/ExternalApi.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -259,6 +260,6 @@ public Builder clearSimpleSearchParams() { /** Deserializes a JSON string to a ExternalApi object. */ @ExcludeFromGeneratedCoverageReport public static ExternalApi fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ExternalApi.class); + return Common.fromJsonString(jsonString, ExternalApi.class); } } diff --git a/src/main/java/com/google/genai/types/ExternalApiElasticSearchParams.java b/src/main/java/com/google/genai/types/ExternalApiElasticSearchParams.java index 52641a46d99..e4331232273 100644 --- a/src/main/java/com/google/genai/types/ExternalApiElasticSearchParams.java +++ b/src/main/java/com/google/genai/types/ExternalApiElasticSearchParams.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -129,6 +130,6 @@ public Builder clearSearchTemplate() { /** Deserializes a JSON string to a ExternalApiElasticSearchParams object. */ @ExcludeFromGeneratedCoverageReport public static ExternalApiElasticSearchParams fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ExternalApiElasticSearchParams.class); + return Common.fromJsonString(jsonString, ExternalApiElasticSearchParams.class); } } diff --git a/src/main/java/com/google/genai/types/ExternalApiSimpleSearchParams.java b/src/main/java/com/google/genai/types/ExternalApiSimpleSearchParams.java index b82a413cd90..26b7c194398 100644 --- a/src/main/java/com/google/genai/types/ExternalApiSimpleSearchParams.java +++ b/src/main/java/com/google/genai/types/ExternalApiSimpleSearchParams.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -56,6 +57,6 @@ private static Builder create() { /** Deserializes a JSON string to a ExternalApiSimpleSearchParams object. */ @ExcludeFromGeneratedCoverageReport public static ExternalApiSimpleSearchParams fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ExternalApiSimpleSearchParams.class); + return Common.fromJsonString(jsonString, ExternalApiSimpleSearchParams.class); } } diff --git a/src/main/java/com/google/genai/types/FetchPredictOperationConfig.java b/src/main/java/com/google/genai/types/FetchPredictOperationConfig.java index 66d4bb0481f..29381e10ba6 100644 --- a/src/main/java/com/google/genai/types/FetchPredictOperationConfig.java +++ b/src/main/java/com/google/genai/types/FetchPredictOperationConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a FetchPredictOperationConfig object. */ @ExcludeFromGeneratedCoverageReport public static FetchPredictOperationConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FetchPredictOperationConfig.class); + return Common.fromJsonString(jsonString, FetchPredictOperationConfig.class); } } diff --git a/src/main/java/com/google/genai/types/FetchPredictOperationParameters.java b/src/main/java/com/google/genai/types/FetchPredictOperationParameters.java index 6f35fd8b759..63898e40dd2 100644 --- a/src/main/java/com/google/genai/types/FetchPredictOperationParameters.java +++ b/src/main/java/com/google/genai/types/FetchPredictOperationParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -134,6 +135,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a FetchPredictOperationParameters object. */ @ExcludeFromGeneratedCoverageReport public static FetchPredictOperationParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FetchPredictOperationParameters.class); + return Common.fromJsonString(jsonString, FetchPredictOperationParameters.class); } } diff --git a/src/main/java/com/google/genai/types/File.java b/src/main/java/com/google/genai/types/File.java index ac201db03c1..5a0a72d465a 100644 --- a/src/main/java/com/google/genai/types/File.java +++ b/src/main/java/com/google/genai/types/File.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Map; @@ -433,6 +434,6 @@ public Builder clearError() { /** Deserializes a JSON string to a File object. */ @ExcludeFromGeneratedCoverageReport public static File fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, File.class); + return Common.fromJsonString(jsonString, File.class); } } diff --git a/src/main/java/com/google/genai/types/FileData.java b/src/main/java/com/google/genai/types/FileData.java index afb386ac60f..59a3d794def 100644 --- a/src/main/java/com/google/genai/types/FileData.java +++ b/src/main/java/com/google/genai/types/FileData.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -131,6 +132,6 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a FileData object. */ @ExcludeFromGeneratedCoverageReport public static FileData fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FileData.class); + return Common.fromJsonString(jsonString, FileData.class); } } diff --git a/src/main/java/com/google/genai/types/FileSearch.java b/src/main/java/com/google/genai/types/FileSearch.java index 1887e04ba85..e2b5dfc5796 100644 --- a/src/main/java/com/google/genai/types/FileSearch.java +++ b/src/main/java/com/google/genai/types/FileSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -142,6 +143,6 @@ public Builder clearMetadataFilter() { /** Deserializes a JSON string to a FileSearch object. */ @ExcludeFromGeneratedCoverageReport public static FileSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FileSearch.class); + return Common.fromJsonString(jsonString, FileSearch.class); } } diff --git a/src/main/java/com/google/genai/types/FileSearchStore.java b/src/main/java/com/google/genai/types/FileSearchStore.java index 21799ee1200..666d249b54b 100644 --- a/src/main/java/com/google/genai/types/FileSearchStore.java +++ b/src/main/java/com/google/genai/types/FileSearchStore.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -280,6 +281,6 @@ public Builder clearEmbeddingModel() { /** Deserializes a JSON string to a FileSearchStore object. */ @ExcludeFromGeneratedCoverageReport public static FileSearchStore fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FileSearchStore.class); + return Common.fromJsonString(jsonString, FileSearchStore.class); } } diff --git a/src/main/java/com/google/genai/types/FileStatus.java b/src/main/java/com/google/genai/types/FileStatus.java index 00729903473..e908bae8e70 100644 --- a/src/main/java/com/google/genai/types/FileStatus.java +++ b/src/main/java/com/google/genai/types/FileStatus.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -142,6 +143,6 @@ public Builder clearCode() { /** Deserializes a JSON string to a FileStatus object. */ @ExcludeFromGeneratedCoverageReport public static FileStatus fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FileStatus.class); + return Common.fromJsonString(jsonString, FileStatus.class); } } diff --git a/src/main/java/com/google/genai/types/FullFineTuningSpec.java b/src/main/java/com/google/genai/types/FullFineTuningSpec.java index 295cc4604fd..b11c1ab0767 100644 --- a/src/main/java/com/google/genai/types/FullFineTuningSpec.java +++ b/src/main/java/com/google/genai/types/FullFineTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -140,6 +141,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a FullFineTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static FullFineTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FullFineTuningSpec.class); + return Common.fromJsonString(jsonString, FullFineTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionCall.java b/src/main/java/com/google/genai/types/FunctionCall.java index 6094f0b4541..b6c4232a6b7 100644 --- a/src/main/java/com/google/genai/types/FunctionCall.java +++ b/src/main/java/com/google/genai/types/FunctionCall.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -217,6 +218,6 @@ public Builder clearWillContinue() { /** Deserializes a JSON string to a FunctionCall object. */ @ExcludeFromGeneratedCoverageReport public static FunctionCall fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionCall.class); + return Common.fromJsonString(jsonString, FunctionCall.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionCallingConfig.java b/src/main/java/com/google/genai/types/FunctionCallingConfig.java index f0be8974339..c8a328dcd10 100644 --- a/src/main/java/com/google/genai/types/FunctionCallingConfig.java +++ b/src/main/java/com/google/genai/types/FunctionCallingConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -167,6 +168,6 @@ public Builder clearStreamFunctionCallArguments() { /** Deserializes a JSON string to a FunctionCallingConfig object. */ @ExcludeFromGeneratedCoverageReport public static FunctionCallingConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionCallingConfig.class); + return Common.fromJsonString(jsonString, FunctionCallingConfig.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionDeclaration.java b/src/main/java/com/google/genai/types/FunctionDeclaration.java index cca7a2e9ed0..9114db9189a 100644 --- a/src/main/java/com/google/genai/types/FunctionDeclaration.java +++ b/src/main/java/com/google/genai/types/FunctionDeclaration.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -325,7 +326,7 @@ public Builder behavior(String behavior) { /** Deserializes a JSON string to a FunctionDeclaration object. */ @ExcludeFromGeneratedCoverageReport public static FunctionDeclaration fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionDeclaration.class); + return Common.fromJsonString(jsonString, FunctionDeclaration.class); } /** diff --git a/src/main/java/com/google/genai/types/FunctionResponse.java b/src/main/java/com/google/genai/types/FunctionResponse.java index cc220fcb59d..c1171566dc3 100644 --- a/src/main/java/com/google/genai/types/FunctionResponse.java +++ b/src/main/java/com/google/genai/types/FunctionResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -279,6 +280,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a FunctionResponse object. */ @ExcludeFromGeneratedCoverageReport public static FunctionResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionResponse.class); + return Common.fromJsonString(jsonString, FunctionResponse.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionResponseBlob.java b/src/main/java/com/google/genai/types/FunctionResponseBlob.java index a3c59e8265a..3c92d3ca5d5 100644 --- a/src/main/java/com/google/genai/types/FunctionResponseBlob.java +++ b/src/main/java/com/google/genai/types/FunctionResponseBlob.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -132,6 +133,6 @@ public Builder clearDisplayName() { /** Deserializes a JSON string to a FunctionResponseBlob object. */ @ExcludeFromGeneratedCoverageReport public static FunctionResponseBlob fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionResponseBlob.class); + return Common.fromJsonString(jsonString, FunctionResponseBlob.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionResponseFileData.java b/src/main/java/com/google/genai/types/FunctionResponseFileData.java index 2b346a2fb4e..228e096ae1e 100644 --- a/src/main/java/com/google/genai/types/FunctionResponseFileData.java +++ b/src/main/java/com/google/genai/types/FunctionResponseFileData.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -128,6 +129,6 @@ public Builder clearDisplayName() { /** Deserializes a JSON string to a FunctionResponseFileData object. */ @ExcludeFromGeneratedCoverageReport public static FunctionResponseFileData fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionResponseFileData.class); + return Common.fromJsonString(jsonString, FunctionResponseFileData.class); } } diff --git a/src/main/java/com/google/genai/types/FunctionResponsePart.java b/src/main/java/com/google/genai/types/FunctionResponsePart.java index 0d545e1022a..0e60299f79d 100644 --- a/src/main/java/com/google/genai/types/FunctionResponsePart.java +++ b/src/main/java/com/google/genai/types/FunctionResponsePart.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -124,7 +125,7 @@ public Builder clearFileData() { /** Deserializes a JSON string to a FunctionResponsePart object. */ @ExcludeFromGeneratedCoverageReport public static FunctionResponsePart fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, FunctionResponsePart.class); + return Common.fromJsonString(jsonString, FunctionResponsePart.class); } /** diff --git a/src/main/java/com/google/genai/types/GcsDestination.java b/src/main/java/com/google/genai/types/GcsDestination.java index 8c0acbfb8b1..4ac25207587 100644 --- a/src/main/java/com/google/genai/types/GcsDestination.java +++ b/src/main/java/com/google/genai/types/GcsDestination.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -81,6 +82,6 @@ public Builder clearOutputUriPrefix() { /** Deserializes a JSON string to a GcsDestination object. */ @ExcludeFromGeneratedCoverageReport public static GcsDestination fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GcsDestination.class); + return Common.fromJsonString(jsonString, GcsDestination.class); } } diff --git a/src/main/java/com/google/genai/types/GcsSource.java b/src/main/java/com/google/genai/types/GcsSource.java index 818d548b6c5..80c43d42d69 100644 --- a/src/main/java/com/google/genai/types/GcsSource.java +++ b/src/main/java/com/google/genai/types/GcsSource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -96,6 +97,6 @@ public Builder clearUris() { /** Deserializes a JSON string to a GcsSource object. */ @ExcludeFromGeneratedCoverageReport public static GcsSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GcsSource.class); + return Common.fromJsonString(jsonString, GcsSource.class); } } diff --git a/src/main/java/com/google/genai/types/GeminiPreferenceExample.java b/src/main/java/com/google/genai/types/GeminiPreferenceExample.java index b83df735e44..32f74f94fe5 100644 --- a/src/main/java/com/google/genai/types/GeminiPreferenceExample.java +++ b/src/main/java/com/google/genai/types/GeminiPreferenceExample.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -148,6 +149,6 @@ public Builder clearContents() { /** Deserializes a JSON string to a GeminiPreferenceExample object. */ @ExcludeFromGeneratedCoverageReport public static GeminiPreferenceExample fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GeminiPreferenceExample.class); + return Common.fromJsonString(jsonString, GeminiPreferenceExample.class); } } diff --git a/src/main/java/com/google/genai/types/GeminiPreferenceExampleCompletion.java b/src/main/java/com/google/genai/types/GeminiPreferenceExampleCompletion.java index 7780ab52c9f..c3e2db45e69 100644 --- a/src/main/java/com/google/genai/types/GeminiPreferenceExampleCompletion.java +++ b/src/main/java/com/google/genai/types/GeminiPreferenceExampleCompletion.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -111,6 +112,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a GeminiPreferenceExampleCompletion object. */ @ExcludeFromGeneratedCoverageReport public static GeminiPreferenceExampleCompletion fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GeminiPreferenceExampleCompletion.class); + return Common.fromJsonString(jsonString, GeminiPreferenceExampleCompletion.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateContentConfig.java b/src/main/java/com/google/genai/types/GenerateContentConfig.java index 4b502df98cc..2c45d88f174 100644 --- a/src/main/java/com/google/genai/types/GenerateContentConfig.java +++ b/src/main/java/com/google/genai/types/GenerateContentConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -1188,6 +1189,6 @@ public Builder clearAudioTranscriptionConfig() { /** Deserializes a JSON string to a GenerateContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static GenerateContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateContentConfig.class); + return Common.fromJsonString(jsonString, GenerateContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateContentParameters.java b/src/main/java/com/google/genai/types/GenerateContentParameters.java index 596ecf4d10c..d0b31c3d26c 100644 --- a/src/main/java/com/google/genai/types/GenerateContentParameters.java +++ b/src/main/java/com/google/genai/types/GenerateContentParameters.java @@ -26,6 +26,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GenerateContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static GenerateContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateContentParameters.class); + return Common.fromJsonString(jsonString, GenerateContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateContentResponse.java b/src/main/java/com/google/genai/types/GenerateContentResponse.java index decb22d1b7b..e6e66b806ce 100644 --- a/src/main/java/com/google/genai/types/GenerateContentResponse.java +++ b/src/main/java/com/google/genai/types/GenerateContentResponse.java @@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.ArrayList; @@ -369,7 +370,7 @@ public Builder clearModelStatus() { /** Deserializes a JSON string to a GenerateContentResponse object. */ @ExcludeFromGeneratedCoverageReport public static GenerateContentResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateContentResponse.class); + return Common.fromJsonString(jsonString, GenerateContentResponse.class); } private static final Logger logger = Logger.getLogger(GenerateContentResponse.class.getName()); diff --git a/src/main/java/com/google/genai/types/GenerateContentResponsePromptFeedback.java b/src/main/java/com/google/genai/types/GenerateContentResponsePromptFeedback.java index b42304de4bf..707c5e91a78 100644 --- a/src/main/java/com/google/genai/types/GenerateContentResponsePromptFeedback.java +++ b/src/main/java/com/google/genai/types/GenerateContentResponsePromptFeedback.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -180,6 +181,6 @@ public Builder clearSafetyRatings() { /** Deserializes a JSON string to a GenerateContentResponsePromptFeedback object. */ @ExcludeFromGeneratedCoverageReport public static GenerateContentResponsePromptFeedback fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateContentResponsePromptFeedback.class); + return Common.fromJsonString(jsonString, GenerateContentResponsePromptFeedback.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateContentResponseUsageMetadata.java b/src/main/java/com/google/genai/types/GenerateContentResponseUsageMetadata.java index f01a6e5b1df..1e81eb19489 100644 --- a/src/main/java/com/google/genai/types/GenerateContentResponseUsageMetadata.java +++ b/src/main/java/com/google/genai/types/GenerateContentResponseUsageMetadata.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -465,6 +466,6 @@ public Builder trafficType(String trafficType) { /** Deserializes a JSON string to a GenerateContentResponseUsageMetadata object. */ @ExcludeFromGeneratedCoverageReport public static GenerateContentResponseUsageMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateContentResponseUsageMetadata.class); + return Common.fromJsonString(jsonString, GenerateContentResponseUsageMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateImagesConfig.java b/src/main/java/com/google/genai/types/GenerateImagesConfig.java index ead88f4d43b..d387d5e9625 100644 --- a/src/main/java/com/google/genai/types/GenerateImagesConfig.java +++ b/src/main/java/com/google/genai/types/GenerateImagesConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -545,6 +546,6 @@ public Builder clearEnhancePrompt() { /** Deserializes a JSON string to a GenerateImagesConfig object. */ @ExcludeFromGeneratedCoverageReport public static GenerateImagesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateImagesConfig.class); + return Common.fromJsonString(jsonString, GenerateImagesConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateImagesParameters.java b/src/main/java/com/google/genai/types/GenerateImagesParameters.java index 913718aa6fe..ac1ec856773 100644 --- a/src/main/java/com/google/genai/types/GenerateImagesParameters.java +++ b/src/main/java/com/google/genai/types/GenerateImagesParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -136,6 +137,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GenerateImagesParameters object. */ @ExcludeFromGeneratedCoverageReport public static GenerateImagesParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateImagesParameters.class); + return Common.fromJsonString(jsonString, GenerateImagesParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateImagesResponse.java b/src/main/java/com/google/genai/types/GenerateImagesResponse.java index 947a0f53dc3..fc0384460a5 100644 --- a/src/main/java/com/google/genai/types/GenerateImagesResponse.java +++ b/src/main/java/com/google/genai/types/GenerateImagesResponse.java @@ -26,6 +26,7 @@ import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -178,7 +179,7 @@ public Builder clearPositivePromptSafetyAttributes() { /** Deserializes a JSON string to a GenerateImagesResponse object. */ @ExcludeFromGeneratedCoverageReport public static GenerateImagesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateImagesResponse.class); + return Common.fromJsonString(jsonString, GenerateImagesResponse.class); } /** diff --git a/src/main/java/com/google/genai/types/GenerateVideosConfig.java b/src/main/java/com/google/genai/types/GenerateVideosConfig.java index b40b56e3c62..820e39e22cb 100644 --- a/src/main/java/com/google/genai/types/GenerateVideosConfig.java +++ b/src/main/java/com/google/genai/types/GenerateVideosConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -640,6 +641,6 @@ public Builder resizeMode(String resizeMode) { /** Deserializes a JSON string to a GenerateVideosConfig object. */ @ExcludeFromGeneratedCoverageReport public static GenerateVideosConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateVideosConfig.class); + return Common.fromJsonString(jsonString, GenerateVideosConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateVideosOperation.java b/src/main/java/com/google/genai/types/GenerateVideosOperation.java index 98a80fe31aa..1f5bc1401eb 100644 --- a/src/main/java/com/google/genai/types/GenerateVideosOperation.java +++ b/src/main/java/com/google/genai/types/GenerateVideosOperation.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.genai.JsonSerializable; +import com.google.genai.Common; import com.google.genai.OperationsConverters; import java.util.Map; import java.util.Optional; @@ -50,7 +50,7 @@ public GenerateVideosOperation fromApiResponse(JsonNode apiResponse, boolean isV response = converter.generateVideosOperationFromMldev(apiResponse, null); } - return JsonSerializable.fromJsonNode(response, GenerateVideosOperation.class); + return Common.fromJsonNode(response, GenerateVideosOperation.class); } /** Instantiates a builder for GenerateVideosOperation. */ @@ -183,6 +183,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a GenerateVideosOperation object. */ @ExcludeFromGeneratedCoverageReport public static GenerateVideosOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateVideosOperation.class); + return Common.fromJsonString(jsonString, GenerateVideosOperation.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateVideosParameters.java b/src/main/java/com/google/genai/types/GenerateVideosParameters.java index 7efc4734ced..fb27c1ec54a 100644 --- a/src/main/java/com/google/genai/types/GenerateVideosParameters.java +++ b/src/main/java/com/google/genai/types/GenerateVideosParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -242,6 +243,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GenerateVideosParameters object. */ @ExcludeFromGeneratedCoverageReport public static GenerateVideosParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateVideosParameters.class); + return Common.fromJsonString(jsonString, GenerateVideosParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateVideosResponse.java b/src/main/java/com/google/genai/types/GenerateVideosResponse.java index cc0ebc6fd4f..99564e6a8a4 100644 --- a/src/main/java/com/google/genai/types/GenerateVideosResponse.java +++ b/src/main/java/com/google/genai/types/GenerateVideosResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -157,6 +158,6 @@ public Builder clearRaiMediaFilteredReasons() { /** Deserializes a JSON string to a GenerateVideosResponse object. */ @ExcludeFromGeneratedCoverageReport public static GenerateVideosResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateVideosResponse.class); + return Common.fromJsonString(jsonString, GenerateVideosResponse.class); } } diff --git a/src/main/java/com/google/genai/types/GenerateVideosSource.java b/src/main/java/com/google/genai/types/GenerateVideosSource.java index babb5924c9c..590d30f1f5e 100644 --- a/src/main/java/com/google/genai/types/GenerateVideosSource.java +++ b/src/main/java/com/google/genai/types/GenerateVideosSource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -150,6 +151,6 @@ public Builder clearVideo() { /** Deserializes a JSON string to a GenerateVideosSource object. */ @ExcludeFromGeneratedCoverageReport public static GenerateVideosSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerateVideosSource.class); + return Common.fromJsonString(jsonString, GenerateVideosSource.class); } } diff --git a/src/main/java/com/google/genai/types/GeneratedImage.java b/src/main/java/com/google/genai/types/GeneratedImage.java index 64587a49f24..1d2da8c7f40 100644 --- a/src/main/java/com/google/genai/types/GeneratedImage.java +++ b/src/main/java/com/google/genai/types/GeneratedImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -166,6 +167,6 @@ public Builder clearEnhancedPrompt() { /** Deserializes a JSON string to a GeneratedImage object. */ @ExcludeFromGeneratedCoverageReport public static GeneratedImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GeneratedImage.class); + return Common.fromJsonString(jsonString, GeneratedImage.class); } } diff --git a/src/main/java/com/google/genai/types/GeneratedImageMask.java b/src/main/java/com/google/genai/types/GeneratedImageMask.java index 5d5f441a66d..95c40b1f96c 100644 --- a/src/main/java/com/google/genai/types/GeneratedImageMask.java +++ b/src/main/java/com/google/genai/types/GeneratedImageMask.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -135,6 +136,6 @@ public Builder clearLabels() { /** Deserializes a JSON string to a GeneratedImageMask object. */ @ExcludeFromGeneratedCoverageReport public static GeneratedImageMask fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GeneratedImageMask.class); + return Common.fromJsonString(jsonString, GeneratedImageMask.class); } } diff --git a/src/main/java/com/google/genai/types/GeneratedVideo.java b/src/main/java/com/google/genai/types/GeneratedVideo.java index fd806eaa1cb..11da821a2b3 100644 --- a/src/main/java/com/google/genai/types/GeneratedVideo.java +++ b/src/main/java/com/google/genai/types/GeneratedVideo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearVideo() { /** Deserializes a JSON string to a GeneratedVideo object. */ @ExcludeFromGeneratedCoverageReport public static GeneratedVideo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GeneratedVideo.class); + return Common.fromJsonString(jsonString, GeneratedVideo.class); } } diff --git a/src/main/java/com/google/genai/types/GenerationConfig.java b/src/main/java/com/google/genai/types/GenerationConfig.java index 8cc5d6b642b..6b9131340b3 100644 --- a/src/main/java/com/google/genai/types/GenerationConfig.java +++ b/src/main/java/com/google/genai/types/GenerationConfig.java @@ -26,6 +26,7 @@ import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -991,6 +992,6 @@ public Builder clearAudioTranscriptionConfig() { /** Deserializes a JSON string to a GenerationConfig object. */ @ExcludeFromGeneratedCoverageReport public static GenerationConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerationConfig.class); + return Common.fromJsonString(jsonString, GenerationConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfig.java b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfig.java index 7a093df5126..2f52a6728ab 100644 --- a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfig.java +++ b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -128,6 +129,6 @@ public Builder clearManualMode() { /** Deserializes a JSON string to a GenerationConfigRoutingConfig object. */ @ExcludeFromGeneratedCoverageReport public static GenerationConfigRoutingConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GenerationConfigRoutingConfig.class); + return Common.fromJsonString(jsonString, GenerationConfigRoutingConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigAutoRoutingMode.java b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigAutoRoutingMode.java index f705a757dc2..923e70b4f31 100644 --- a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigAutoRoutingMode.java +++ b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigAutoRoutingMode.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -104,7 +105,6 @@ public Builder modelRoutingPreference(String modelRoutingPreference) { /** Deserializes a JSON string to a GenerationConfigRoutingConfigAutoRoutingMode object. */ @ExcludeFromGeneratedCoverageReport public static GenerationConfigRoutingConfigAutoRoutingMode fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerationConfigRoutingConfigAutoRoutingMode.class); + return Common.fromJsonString(jsonString, GenerationConfigRoutingConfigAutoRoutingMode.class); } } diff --git a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigManualRoutingMode.java b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigManualRoutingMode.java index f897bfd8d97..5d2b528bdbf 100644 --- a/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigManualRoutingMode.java +++ b/src/main/java/com/google/genai/types/GenerationConfigRoutingConfigManualRoutingMode.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -82,7 +83,6 @@ public Builder clearModelName() { /** Deserializes a JSON string to a GenerationConfigRoutingConfigManualRoutingMode object. */ @ExcludeFromGeneratedCoverageReport public static GenerationConfigRoutingConfigManualRoutingMode fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, GenerationConfigRoutingConfigManualRoutingMode.class); + return Common.fromJsonString(jsonString, GenerationConfigRoutingConfigManualRoutingMode.class); } } diff --git a/src/main/java/com/google/genai/types/GetBatchJobConfig.java b/src/main/java/com/google/genai/types/GetBatchJobConfig.java index 33c004d3b45..9d225d268eb 100644 --- a/src/main/java/com/google/genai/types/GetBatchJobConfig.java +++ b/src/main/java/com/google/genai/types/GetBatchJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetBatchJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetBatchJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetBatchJobConfig.class); + return Common.fromJsonString(jsonString, GetBatchJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetBatchJobParameters.java b/src/main/java/com/google/genai/types/GetBatchJobParameters.java index 3126e61bb2f..c309e847e97 100644 --- a/src/main/java/com/google/genai/types/GetBatchJobParameters.java +++ b/src/main/java/com/google/genai/types/GetBatchJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -116,6 +117,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetBatchJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetBatchJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetBatchJobParameters.class); + return Common.fromJsonString(jsonString, GetBatchJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetCachedContentConfig.java b/src/main/java/com/google/genai/types/GetCachedContentConfig.java index be1a1e0b936..886e6ca6fb4 100644 --- a/src/main/java/com/google/genai/types/GetCachedContentConfig.java +++ b/src/main/java/com/google/genai/types/GetCachedContentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetCachedContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetCachedContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetCachedContentConfig.class); + return Common.fromJsonString(jsonString, GetCachedContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetCachedContentParameters.java b/src/main/java/com/google/genai/types/GetCachedContentParameters.java index 1b2ac0dcb77..e214eef60c4 100644 --- a/src/main/java/com/google/genai/types/GetCachedContentParameters.java +++ b/src/main/java/com/google/genai/types/GetCachedContentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetCachedContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetCachedContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetCachedContentParameters.class); + return Common.fromJsonString(jsonString, GetCachedContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetDocumentConfig.java b/src/main/java/com/google/genai/types/GetDocumentConfig.java index f45622f0f27..8633fd8315d 100644 --- a/src/main/java/com/google/genai/types/GetDocumentConfig.java +++ b/src/main/java/com/google/genai/types/GetDocumentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetDocumentConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetDocumentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetDocumentConfig.class); + return Common.fromJsonString(jsonString, GetDocumentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetDocumentParameters.java b/src/main/java/com/google/genai/types/GetDocumentParameters.java index 93ec5a21142..3c970d7c962 100644 --- a/src/main/java/com/google/genai/types/GetDocumentParameters.java +++ b/src/main/java/com/google/genai/types/GetDocumentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -114,6 +115,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetDocumentParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetDocumentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetDocumentParameters.class); + return Common.fromJsonString(jsonString, GetDocumentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetFileConfig.java b/src/main/java/com/google/genai/types/GetFileConfig.java index 6eb060d3bde..38c58894f8b 100644 --- a/src/main/java/com/google/genai/types/GetFileConfig.java +++ b/src/main/java/com/google/genai/types/GetFileConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetFileConfig.class); + return Common.fromJsonString(jsonString, GetFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetFileParameters.java b/src/main/java/com/google/genai/types/GetFileParameters.java index 8ea54d39a4a..2209bc261c4 100644 --- a/src/main/java/com/google/genai/types/GetFileParameters.java +++ b/src/main/java/com/google/genai/types/GetFileParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetFileParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetFileParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetFileParameters.class); + return Common.fromJsonString(jsonString, GetFileParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetFileSearchStoreConfig.java b/src/main/java/com/google/genai/types/GetFileSearchStoreConfig.java index 47773d417bc..86b07a48926 100644 --- a/src/main/java/com/google/genai/types/GetFileSearchStoreConfig.java +++ b/src/main/java/com/google/genai/types/GetFileSearchStoreConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetFileSearchStoreConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetFileSearchStoreConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetFileSearchStoreConfig.class); + return Common.fromJsonString(jsonString, GetFileSearchStoreConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetFileSearchStoreParameters.java b/src/main/java/com/google/genai/types/GetFileSearchStoreParameters.java index 15b4632d321..fb775cd09d4 100644 --- a/src/main/java/com/google/genai/types/GetFileSearchStoreParameters.java +++ b/src/main/java/com/google/genai/types/GetFileSearchStoreParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -115,6 +116,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetFileSearchStoreParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetFileSearchStoreParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetFileSearchStoreParameters.class); + return Common.fromJsonString(jsonString, GetFileSearchStoreParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetModelConfig.java b/src/main/java/com/google/genai/types/GetModelConfig.java index 3ccacd8aeba..3dbd5334746 100644 --- a/src/main/java/com/google/genai/types/GetModelConfig.java +++ b/src/main/java/com/google/genai/types/GetModelConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetModelConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetModelConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetModelConfig.class); + return Common.fromJsonString(jsonString, GetModelConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetModelParameters.java b/src/main/java/com/google/genai/types/GetModelParameters.java index c07a55c9217..b3b3ed74f75 100644 --- a/src/main/java/com/google/genai/types/GetModelParameters.java +++ b/src/main/java/com/google/genai/types/GetModelParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetModelParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetModelParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetModelParameters.class); + return Common.fromJsonString(jsonString, GetModelParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetOperationConfig.java b/src/main/java/com/google/genai/types/GetOperationConfig.java index 039d5055d48..bd13373c818 100644 --- a/src/main/java/com/google/genai/types/GetOperationConfig.java +++ b/src/main/java/com/google/genai/types/GetOperationConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetOperationConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetOperationConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetOperationConfig.class); + return Common.fromJsonString(jsonString, GetOperationConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetOperationParameters.java b/src/main/java/com/google/genai/types/GetOperationParameters.java index 7ed6a64d986..1b55d4cabc6 100644 --- a/src/main/java/com/google/genai/types/GetOperationParameters.java +++ b/src/main/java/com/google/genai/types/GetOperationParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetOperationParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetOperationParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetOperationParameters.class); + return Common.fromJsonString(jsonString, GetOperationParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GetTuningJobConfig.java b/src/main/java/com/google/genai/types/GetTuningJobConfig.java index f0a288a2886..66aadbb4a9c 100644 --- a/src/main/java/com/google/genai/types/GetTuningJobConfig.java +++ b/src/main/java/com/google/genai/types/GetTuningJobConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearHttpOptions() { /** Deserializes a JSON string to a GetTuningJobConfig object. */ @ExcludeFromGeneratedCoverageReport public static GetTuningJobConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetTuningJobConfig.class); + return Common.fromJsonString(jsonString, GetTuningJobConfig.class); } } diff --git a/src/main/java/com/google/genai/types/GetTuningJobParameters.java b/src/main/java/com/google/genai/types/GetTuningJobParameters.java index a58ff46ea58..0cd718e8a78 100644 --- a/src/main/java/com/google/genai/types/GetTuningJobParameters.java +++ b/src/main/java/com/google/genai/types/GetTuningJobParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a GetTuningJobParameters object. */ @ExcludeFromGeneratedCoverageReport public static GetTuningJobParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GetTuningJobParameters.class); + return Common.fromJsonString(jsonString, GetTuningJobParameters.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleMaps.java b/src/main/java/com/google/genai/types/GoogleMaps.java index 20a5ba5195b..2cdb5ffae29 100644 --- a/src/main/java/com/google/genai/types/GoogleMaps.java +++ b/src/main/java/com/google/genai/types/GoogleMaps.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -157,6 +158,6 @@ public Builder clearGroundingTypes() { /** Deserializes a JSON string to a GoogleMaps object. */ @ExcludeFromGeneratedCoverageReport public static GoogleMaps fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleMaps.class); + return Common.fromJsonString(jsonString, GoogleMaps.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleMapsGroundingTypes.java b/src/main/java/com/google/genai/types/GoogleMapsGroundingTypes.java index d8786a2a3e9..83def8c1196 100644 --- a/src/main/java/com/google/genai/types/GoogleMapsGroundingTypes.java +++ b/src/main/java/com/google/genai/types/GoogleMapsGroundingTypes.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearRouting() { /** Deserializes a JSON string to a GoogleMapsGroundingTypes object. */ @ExcludeFromGeneratedCoverageReport public static GoogleMapsGroundingTypes fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleMapsGroundingTypes.class); + return Common.fromJsonString(jsonString, GoogleMapsGroundingTypes.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleMapsPlaces.java b/src/main/java/com/google/genai/types/GoogleMapsPlaces.java index 964ec22c569..7c82d892fdd 100644 --- a/src/main/java/com/google/genai/types/GoogleMapsPlaces.java +++ b/src/main/java/com/google/genai/types/GoogleMapsPlaces.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -54,6 +55,6 @@ private static Builder create() { /** Deserializes a JSON string to a GoogleMapsPlaces object. */ @ExcludeFromGeneratedCoverageReport public static GoogleMapsPlaces fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleMapsPlaces.class); + return Common.fromJsonString(jsonString, GoogleMapsPlaces.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleMapsRouting.java b/src/main/java/com/google/genai/types/GoogleMapsRouting.java index 13480dadbf9..8c475d63c1d 100644 --- a/src/main/java/com/google/genai/types/GoogleMapsRouting.java +++ b/src/main/java/com/google/genai/types/GoogleMapsRouting.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -54,6 +55,6 @@ private static Builder create() { /** Deserializes a JSON string to a GoogleMapsRouting object. */ @ExcludeFromGeneratedCoverageReport public static GoogleMapsRouting fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleMapsRouting.class); + return Common.fromJsonString(jsonString, GoogleMapsRouting.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleRpcStatus.java b/src/main/java/com/google/genai/types/GoogleRpcStatus.java index 703a3e6002b..dc7a46f2b0b 100644 --- a/src/main/java/com/google/genai/types/GoogleRpcStatus.java +++ b/src/main/java/com/google/genai/types/GoogleRpcStatus.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -151,6 +152,6 @@ public Builder clearMessage() { /** Deserializes a JSON string to a GoogleRpcStatus object. */ @ExcludeFromGeneratedCoverageReport public static GoogleRpcStatus fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleRpcStatus.class); + return Common.fromJsonString(jsonString, GoogleRpcStatus.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleSearch.java b/src/main/java/com/google/genai/types/GoogleSearch.java index acbb0d8152a..9722ffb2e23 100644 --- a/src/main/java/com/google/genai/types/GoogleSearch.java +++ b/src/main/java/com/google/genai/types/GoogleSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -216,6 +217,6 @@ public Builder clearTimeRangeFilter() { /** Deserializes a JSON string to a GoogleSearch object. */ @ExcludeFromGeneratedCoverageReport public static GoogleSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleSearch.class); + return Common.fromJsonString(jsonString, GoogleSearch.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleSearchRetrieval.java b/src/main/java/com/google/genai/types/GoogleSearchRetrieval.java index 07ff5418bcc..96ed5baa1d4 100644 --- a/src/main/java/com/google/genai/types/GoogleSearchRetrieval.java +++ b/src/main/java/com/google/genai/types/GoogleSearchRetrieval.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -90,6 +91,6 @@ public Builder clearDynamicRetrievalConfig() { /** Deserializes a JSON string to a GoogleSearchRetrieval object. */ @ExcludeFromGeneratedCoverageReport public static GoogleSearchRetrieval fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleSearchRetrieval.class); + return Common.fromJsonString(jsonString, GoogleSearchRetrieval.class); } } diff --git a/src/main/java/com/google/genai/types/GoogleTypeDate.java b/src/main/java/com/google/genai/types/GoogleTypeDate.java index f8ff77eb411..29dacdf922d 100644 --- a/src/main/java/com/google/genai/types/GoogleTypeDate.java +++ b/src/main/java/com/google/genai/types/GoogleTypeDate.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -133,6 +134,6 @@ public Builder clearYear() { /** Deserializes a JSON string to a GoogleTypeDate object. */ @ExcludeFromGeneratedCoverageReport public static GoogleTypeDate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GoogleTypeDate.class); + return Common.fromJsonString(jsonString, GoogleTypeDate.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunk.java b/src/main/java/com/google/genai/types/GroundingChunk.java index b4e332694b2..f360bab5517 100644 --- a/src/main/java/com/google/genai/types/GroundingChunk.java +++ b/src/main/java/com/google/genai/types/GroundingChunk.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -209,6 +210,6 @@ public Builder clearWeb() { /** Deserializes a JSON string to a GroundingChunk object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunk fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunk.class); + return Common.fromJsonString(jsonString, GroundingChunk.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkCustomMetadata.java b/src/main/java/com/google/genai/types/GroundingChunkCustomMetadata.java index 9839e6d666f..9508bad4916 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkCustomMetadata.java +++ b/src/main/java/com/google/genai/types/GroundingChunkCustomMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -158,6 +159,6 @@ public Builder clearStringValue() { /** Deserializes a JSON string to a GroundingChunkCustomMetadata object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkCustomMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkCustomMetadata.class); + return Common.fromJsonString(jsonString, GroundingChunkCustomMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkImage.java b/src/main/java/com/google/genai/types/GroundingChunkImage.java index 80513f67ab3..f07e3176929 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkImage.java +++ b/src/main/java/com/google/genai/types/GroundingChunkImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -146,6 +147,6 @@ public Builder clearDomain() { /** Deserializes a JSON string to a GroundingChunkImage object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkImage.class); + return Common.fromJsonString(jsonString, GroundingChunkImage.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkMaps.java b/src/main/java/com/google/genai/types/GroundingChunkMaps.java index 7249fe9fa7d..8276359d37f 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkMaps.java +++ b/src/main/java/com/google/genai/types/GroundingChunkMaps.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -231,6 +232,6 @@ public Builder clearRoute() { /** Deserializes a JSON string to a GroundingChunkMaps object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkMaps fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkMaps.class); + return Common.fromJsonString(jsonString, GroundingChunkMaps.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSources.java b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSources.java index 971b9dabd7b..69fc8fa2b9a 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSources.java +++ b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSources.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -187,6 +188,6 @@ public Builder clearReviewSnippets() { /** Deserializes a JSON string to a GroundingChunkMapsPlaceAnswerSources object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkMapsPlaceAnswerSources fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkMapsPlaceAnswerSources.class); + return Common.fromJsonString(jsonString, GroundingChunkMapsPlaceAnswerSources.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.java b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.java index a090bce1681..dac24591477 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.java +++ b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -126,7 +127,7 @@ public Builder clearUri() { */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution fromJson(String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.java b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.java index a29e3ca7300..a05e958ca54 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.java +++ b/src/main/java/com/google/genai/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -234,7 +235,7 @@ public Builder clearTitle() { /** Deserializes a JSON string to a GroundingChunkMapsPlaceAnswerSourcesReviewSnippet object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkMapsPlaceAnswerSourcesReviewSnippet fromJson(String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkMapsRoute.java b/src/main/java/com/google/genai/types/GroundingChunkMapsRoute.java index 431a030c976..9dea4c16881 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkMapsRoute.java +++ b/src/main/java/com/google/genai/types/GroundingChunkMapsRoute.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Optional; @@ -125,6 +126,6 @@ public Builder clearEncodedPolyline() { /** Deserializes a JSON string to a GroundingChunkMapsRoute object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkMapsRoute fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkMapsRoute.class); + return Common.fromJsonString(jsonString, GroundingChunkMapsRoute.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkRetrievedContext.java b/src/main/java/com/google/genai/types/GroundingChunkRetrievedContext.java index 53d5e1ded4c..b13a0d5eaa2 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkRetrievedContext.java +++ b/src/main/java/com/google/genai/types/GroundingChunkRetrievedContext.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -329,6 +330,6 @@ public Builder clearMediaId() { /** Deserializes a JSON string to a GroundingChunkRetrievedContext object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkRetrievedContext fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkRetrievedContext.class); + return Common.fromJsonString(jsonString, GroundingChunkRetrievedContext.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkStringList.java b/src/main/java/com/google/genai/types/GroundingChunkStringList.java index 10eb44ea126..87957243c9f 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkStringList.java +++ b/src/main/java/com/google/genai/types/GroundingChunkStringList.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -88,6 +89,6 @@ public Builder clearValues() { /** Deserializes a JSON string to a GroundingChunkStringList object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkStringList fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkStringList.class); + return Common.fromJsonString(jsonString, GroundingChunkStringList.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingChunkWeb.java b/src/main/java/com/google/genai/types/GroundingChunkWeb.java index 0aaa647111a..54794f2b08f 100644 --- a/src/main/java/com/google/genai/types/GroundingChunkWeb.java +++ b/src/main/java/com/google/genai/types/GroundingChunkWeb.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -128,6 +129,6 @@ public Builder clearUri() { /** Deserializes a JSON string to a GroundingChunkWeb object. */ @ExcludeFromGeneratedCoverageReport public static GroundingChunkWeb fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingChunkWeb.class); + return Common.fromJsonString(jsonString, GroundingChunkWeb.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingMetadata.java b/src/main/java/com/google/genai/types/GroundingMetadata.java index 5e9fe0d8b4a..115964385ac 100644 --- a/src/main/java/com/google/genai/types/GroundingMetadata.java +++ b/src/main/java/com/google/genai/types/GroundingMetadata.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -422,6 +423,6 @@ public Builder clearSourceFlaggingUris() { /** Deserializes a JSON string to a GroundingMetadata object. */ @ExcludeFromGeneratedCoverageReport public static GroundingMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingMetadata.class); + return Common.fromJsonString(jsonString, GroundingMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingMetadataSourceFlaggingUri.java b/src/main/java/com/google/genai/types/GroundingMetadataSourceFlaggingUri.java index e6e89599e60..82af99869cd 100644 --- a/src/main/java/com/google/genai/types/GroundingMetadataSourceFlaggingUri.java +++ b/src/main/java/com/google/genai/types/GroundingMetadataSourceFlaggingUri.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -104,6 +105,6 @@ public Builder clearSourceId() { /** Deserializes a JSON string to a GroundingMetadataSourceFlaggingUri object. */ @ExcludeFromGeneratedCoverageReport public static GroundingMetadataSourceFlaggingUri fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingMetadataSourceFlaggingUri.class); + return Common.fromJsonString(jsonString, GroundingMetadataSourceFlaggingUri.class); } } diff --git a/src/main/java/com/google/genai/types/GroundingSupport.java b/src/main/java/com/google/genai/types/GroundingSupport.java index 9cfa38df37c..b36b6f48fa0 100644 --- a/src/main/java/com/google/genai/types/GroundingSupport.java +++ b/src/main/java/com/google/genai/types/GroundingSupport.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -208,6 +209,6 @@ public Builder clearRenderedParts() { /** Deserializes a JSON string to a GroundingSupport object. */ @ExcludeFromGeneratedCoverageReport public static GroundingSupport fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, GroundingSupport.class); + return Common.fromJsonString(jsonString, GroundingSupport.class); } } diff --git a/src/main/java/com/google/genai/types/HistoryConfig.java b/src/main/java/com/google/genai/types/HistoryConfig.java index 197ca74e3ec..e9c6c31194e 100644 --- a/src/main/java/com/google/genai/types/HistoryConfig.java +++ b/src/main/java/com/google/genai/types/HistoryConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -85,6 +86,6 @@ public Builder clearInitialHistoryInClientContent() { /** Deserializes a JSON string to a HistoryConfig object. */ @ExcludeFromGeneratedCoverageReport public static HistoryConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, HistoryConfig.class); + return Common.fromJsonString(jsonString, HistoryConfig.class); } } diff --git a/src/main/java/com/google/genai/types/HttpOptions.java b/src/main/java/com/google/genai/types/HttpOptions.java index d078c38680e..09979e6a90b 100644 --- a/src/main/java/com/google/genai/types/HttpOptions.java +++ b/src/main/java/com/google/genai/types/HttpOptions.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -250,6 +251,6 @@ public Builder clearRetryOptions() { /** Deserializes a JSON string to a HttpOptions object. */ @ExcludeFromGeneratedCoverageReport public static HttpOptions fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, HttpOptions.class); + return Common.fromJsonString(jsonString, HttpOptions.class); } } diff --git a/src/main/java/com/google/genai/types/HttpResponse.java b/src/main/java/com/google/genai/types/HttpResponse.java index a1b314fc15d..7016bcd30ef 100644 --- a/src/main/java/com/google/genai/types/HttpResponse.java +++ b/src/main/java/com/google/genai/types/HttpResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -99,6 +100,6 @@ public Builder clearBody() { /** Deserializes a JSON string to a HttpResponse object. */ @ExcludeFromGeneratedCoverageReport public static HttpResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, HttpResponse.class); + return Common.fromJsonString(jsonString, HttpResponse.class); } } diff --git a/src/main/java/com/google/genai/types/HttpRetryOptions.java b/src/main/java/com/google/genai/types/HttpRetryOptions.java index 482d617911c..9c82564aea1 100644 --- a/src/main/java/com/google/genai/types/HttpRetryOptions.java +++ b/src/main/java/com/google/genai/types/HttpRetryOptions.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -218,6 +219,6 @@ public Builder clearHttpStatusCodes() { /** Deserializes a JSON string to a HttpRetryOptions object. */ @ExcludeFromGeneratedCoverageReport public static HttpRetryOptions fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, HttpRetryOptions.class); + return Common.fromJsonString(jsonString, HttpRetryOptions.class); } } diff --git a/src/main/java/com/google/genai/types/Image.java b/src/main/java/com/google/genai/types/Image.java index a1d4d4a0657..6e8abbf38a2 100644 --- a/src/main/java/com/google/genai/types/Image.java +++ b/src/main/java/com/google/genai/types/Image.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import com.google.genai.errors.GenAiIOException; import java.io.File; @@ -133,7 +134,7 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a Image object. */ @ExcludeFromGeneratedCoverageReport public static Image fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Image.class); + return Common.fromJsonString(jsonString, Image.class); } /** diff --git a/src/main/java/com/google/genai/types/ImageConfig.java b/src/main/java/com/google/genai/types/ImageConfig.java index f2a9ae725bf..0a7d1f06ad8 100644 --- a/src/main/java/com/google/genai/types/ImageConfig.java +++ b/src/main/java/com/google/genai/types/ImageConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -277,6 +278,6 @@ public Builder clearImageOutputOptions() { /** Deserializes a JSON string to a ImageConfig object. */ @ExcludeFromGeneratedCoverageReport public static ImageConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImageConfig.class); + return Common.fromJsonString(jsonString, ImageConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ImageConfigImageOutputOptions.java b/src/main/java/com/google/genai/types/ImageConfigImageOutputOptions.java index d5e4c544f63..880cfc23698 100644 --- a/src/main/java/com/google/genai/types/ImageConfigImageOutputOptions.java +++ b/src/main/java/com/google/genai/types/ImageConfigImageOutputOptions.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -100,6 +101,6 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a ImageConfigImageOutputOptions object. */ @ExcludeFromGeneratedCoverageReport public static ImageConfigImageOutputOptions fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImageConfigImageOutputOptions.class); + return Common.fromJsonString(jsonString, ImageConfigImageOutputOptions.class); } } diff --git a/src/main/java/com/google/genai/types/ImageResponseFormat.java b/src/main/java/com/google/genai/types/ImageResponseFormat.java index 4c6a07a8b8a..0505ba74056 100644 --- a/src/main/java/com/google/genai/types/ImageResponseFormat.java +++ b/src/main/java/com/google/genai/types/ImageResponseFormat.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -202,6 +203,6 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a ImageResponseFormat object. */ @ExcludeFromGeneratedCoverageReport public static ImageResponseFormat fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImageResponseFormat.class); + return Common.fromJsonString(jsonString, ImageResponseFormat.class); } } diff --git a/src/main/java/com/google/genai/types/ImageSearch.java b/src/main/java/com/google/genai/types/ImageSearch.java index 84cbdf1353f..9cf0839ec0a 100644 --- a/src/main/java/com/google/genai/types/ImageSearch.java +++ b/src/main/java/com/google/genai/types/ImageSearch.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** Image search for grounding and related configurations. */ @@ -51,6 +52,6 @@ private static Builder create() { /** Deserializes a JSON string to a ImageSearch object. */ @ExcludeFromGeneratedCoverageReport public static ImageSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImageSearch.class); + return Common.fromJsonString(jsonString, ImageSearch.class); } } diff --git a/src/main/java/com/google/genai/types/ImportFileConfig.java b/src/main/java/com/google/genai/types/ImportFileConfig.java index 7c6a2f4072f..585d22012d2 100644 --- a/src/main/java/com/google/genai/types/ImportFileConfig.java +++ b/src/main/java/com/google/genai/types/ImportFileConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -167,6 +168,6 @@ public Builder clearChunkingConfig() { /** Deserializes a JSON string to a ImportFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static ImportFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImportFileConfig.class); + return Common.fromJsonString(jsonString, ImportFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ImportFileOperation.java b/src/main/java/com/google/genai/types/ImportFileOperation.java index 0e73c95de35..4af8bc357e3 100644 --- a/src/main/java/com/google/genai/types/ImportFileOperation.java +++ b/src/main/java/com/google/genai/types/ImportFileOperation.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.genai.JsonSerializable; +import com.google.genai.Common; import com.google.genai.OperationsConverters; import java.util.Map; import java.util.Optional; @@ -44,7 +44,7 @@ public ImportFileOperation fromApiResponse(JsonNode apiResponse, boolean isVerte OperationsConverters converter = new OperationsConverters(null); JsonNode response; response = converter.importFileOperationFromMldev(apiResponse, null); - return JsonSerializable.fromJsonNode(response, ImportFileOperation.class); + return Common.fromJsonNode(response, ImportFileOperation.class); } /** Instantiates a builder for ImportFileOperation. */ @@ -177,6 +177,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a ImportFileOperation object. */ @ExcludeFromGeneratedCoverageReport public static ImportFileOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImportFileOperation.class); + return Common.fromJsonString(jsonString, ImportFileOperation.class); } } diff --git a/src/main/java/com/google/genai/types/ImportFileParameters.java b/src/main/java/com/google/genai/types/ImportFileParameters.java index 8ba1b2d2f9e..370bdf27ed2 100644 --- a/src/main/java/com/google/genai/types/ImportFileParameters.java +++ b/src/main/java/com/google/genai/types/ImportFileParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -135,6 +136,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ImportFileParameters object. */ @ExcludeFromGeneratedCoverageReport public static ImportFileParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImportFileParameters.class); + return Common.fromJsonString(jsonString, ImportFileParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ImportFileResponse.java b/src/main/java/com/google/genai/types/ImportFileResponse.java index b80f5bfbc8e..743c1b9bc9f 100644 --- a/src/main/java/com/google/genai/types/ImportFileResponse.java +++ b/src/main/java/com/google/genai/types/ImportFileResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearDocumentName() { /** Deserializes a JSON string to a ImportFileResponse object. */ @ExcludeFromGeneratedCoverageReport public static ImportFileResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ImportFileResponse.class); + return Common.fromJsonString(jsonString, ImportFileResponse.class); } } diff --git a/src/main/java/com/google/genai/types/InlinedEmbedContentResponse.java b/src/main/java/com/google/genai/types/InlinedEmbedContentResponse.java index 1e5641cc012..4c5bef5f900 100644 --- a/src/main/java/com/google/genai/types/InlinedEmbedContentResponse.java +++ b/src/main/java/com/google/genai/types/InlinedEmbedContentResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -141,6 +142,6 @@ public Builder clearMetadata() { /** Deserializes a JSON string to a InlinedEmbedContentResponse object. */ @ExcludeFromGeneratedCoverageReport public static InlinedEmbedContentResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, InlinedEmbedContentResponse.class); + return Common.fromJsonString(jsonString, InlinedEmbedContentResponse.class); } } diff --git a/src/main/java/com/google/genai/types/InlinedRequest.java b/src/main/java/com/google/genai/types/InlinedRequest.java index a6d5c37e17a..a83eb7fe0e6 100644 --- a/src/main/java/com/google/genai/types/InlinedRequest.java +++ b/src/main/java/com/google/genai/types/InlinedRequest.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -184,6 +185,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a InlinedRequest object. */ @ExcludeFromGeneratedCoverageReport public static InlinedRequest fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, InlinedRequest.class); + return Common.fromJsonString(jsonString, InlinedRequest.class); } } diff --git a/src/main/java/com/google/genai/types/InlinedResponse.java b/src/main/java/com/google/genai/types/InlinedResponse.java index 9ce38ad7a4c..cdad9b270be 100644 --- a/src/main/java/com/google/genai/types/InlinedResponse.java +++ b/src/main/java/com/google/genai/types/InlinedResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -141,6 +142,6 @@ public Builder clearError() { /** Deserializes a JSON string to a InlinedResponse object. */ @ExcludeFromGeneratedCoverageReport public static InlinedResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, InlinedResponse.class); + return Common.fromJsonString(jsonString, InlinedResponse.class); } } diff --git a/src/main/java/com/google/genai/types/InternalRegisterFilesParameters.java b/src/main/java/com/google/genai/types/InternalRegisterFilesParameters.java index 4ca274efd74..21cbe3b2aec 100644 --- a/src/main/java/com/google/genai/types/InternalRegisterFilesParameters.java +++ b/src/main/java/com/google/genai/types/InternalRegisterFilesParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -124,6 +125,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a InternalRegisterFilesParameters object. */ @ExcludeFromGeneratedCoverageReport public static InternalRegisterFilesParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, InternalRegisterFilesParameters.class); + return Common.fromJsonString(jsonString, InternalRegisterFilesParameters.class); } } diff --git a/src/main/java/com/google/genai/types/Interval.java b/src/main/java/com/google/genai/types/Interval.java index 84b3b17e228..67379d91279 100644 --- a/src/main/java/com/google/genai/types/Interval.java +++ b/src/main/java/com/google/genai/types/Interval.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearStartTime() { /** Deserializes a JSON string to a Interval object. */ @ExcludeFromGeneratedCoverageReport public static Interval fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Interval.class); + return Common.fromJsonString(jsonString, Interval.class); } } diff --git a/src/main/java/com/google/genai/types/JobError.java b/src/main/java/com/google/genai/types/JobError.java index c24c0de2e7d..bce393a6e38 100644 --- a/src/main/java/com/google/genai/types/JobError.java +++ b/src/main/java/com/google/genai/types/JobError.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -141,6 +142,6 @@ public Builder clearMessage() { /** Deserializes a JSON string to a JobError object. */ @ExcludeFromGeneratedCoverageReport public static JobError fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, JobError.class); + return Common.fromJsonString(jsonString, JobError.class); } } diff --git a/src/main/java/com/google/genai/types/LLMBasedMetricSpec.java b/src/main/java/com/google/genai/types/LLMBasedMetricSpec.java index e8ba2737b33..b52a133f0e0 100644 --- a/src/main/java/com/google/genai/types/LLMBasedMetricSpec.java +++ b/src/main/java/com/google/genai/types/LLMBasedMetricSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -278,6 +279,6 @@ public Builder clearResultParserConfig() { /** Deserializes a JSON string to a LLMBasedMetricSpec object. */ @ExcludeFromGeneratedCoverageReport public static LLMBasedMetricSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LLMBasedMetricSpec.class); + return Common.fromJsonString(jsonString, LLMBasedMetricSpec.class); } } diff --git a/src/main/java/com/google/genai/types/LanguageAuto.java b/src/main/java/com/google/genai/types/LanguageAuto.java index 98c1c5c1114..65806763e9d 100644 --- a/src/main/java/com/google/genai/types/LanguageAuto.java +++ b/src/main/java/com/google/genai/types/LanguageAuto.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** Deprecated: Language auto-detection is now the default when language_codes is omitted. */ @@ -51,6 +52,6 @@ private static Builder create() { /** Deserializes a JSON string to a LanguageAuto object. */ @ExcludeFromGeneratedCoverageReport public static LanguageAuto fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LanguageAuto.class); + return Common.fromJsonString(jsonString, LanguageAuto.class); } } diff --git a/src/main/java/com/google/genai/types/LanguageHints.java b/src/main/java/com/google/genai/types/LanguageHints.java index 9fd72cfb37b..e0c2d296e22 100644 --- a/src/main/java/com/google/genai/types/LanguageHints.java +++ b/src/main/java/com/google/genai/types/LanguageHints.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -88,6 +89,6 @@ public Builder clearLanguageCodes() { /** Deserializes a JSON string to a LanguageHints object. */ @ExcludeFromGeneratedCoverageReport public static LanguageHints fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LanguageHints.class); + return Common.fromJsonString(jsonString, LanguageHints.class); } } diff --git a/src/main/java/com/google/genai/types/LatLng.java b/src/main/java/com/google/genai/types/LatLng.java index 8fcfe133590..9e7bbebbcb9 100644 --- a/src/main/java/com/google/genai/types/LatLng.java +++ b/src/main/java/com/google/genai/types/LatLng.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -102,6 +103,6 @@ public Builder clearLongitude() { /** Deserializes a JSON string to a LatLng object. */ @ExcludeFromGeneratedCoverageReport public static LatLng fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LatLng.class); + return Common.fromJsonString(jsonString, LatLng.class); } } diff --git a/src/main/java/com/google/genai/types/ListBatchJobsConfig.java b/src/main/java/com/google/genai/types/ListBatchJobsConfig.java index 043bf7a8f61..e3a5bd902f2 100644 --- a/src/main/java/com/google/genai/types/ListBatchJobsConfig.java +++ b/src/main/java/com/google/genai/types/ListBatchJobsConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -152,6 +153,6 @@ public Builder clearFilter() { /** Deserializes a JSON string to a ListBatchJobsConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListBatchJobsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListBatchJobsConfig.class); + return Common.fromJsonString(jsonString, ListBatchJobsConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListBatchJobsParameters.java b/src/main/java/com/google/genai/types/ListBatchJobsParameters.java index ad150ddb016..2279fd4c462 100644 --- a/src/main/java/com/google/genai/types/ListBatchJobsParameters.java +++ b/src/main/java/com/google/genai/types/ListBatchJobsParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListBatchJobsParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListBatchJobsParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListBatchJobsParameters.class); + return Common.fromJsonString(jsonString, ListBatchJobsParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListBatchJobsResponse.java b/src/main/java/com/google/genai/types/ListBatchJobsResponse.java index b98c7ac246d..35099f76968 100644 --- a/src/main/java/com/google/genai/types/ListBatchJobsResponse.java +++ b/src/main/java/com/google/genai/types/ListBatchJobsResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -157,6 +158,6 @@ public Builder clearBatchJobs() { /** Deserializes a JSON string to a ListBatchJobsResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListBatchJobsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListBatchJobsResponse.class); + return Common.fromJsonString(jsonString, ListBatchJobsResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListCachedContentsConfig.java b/src/main/java/com/google/genai/types/ListCachedContentsConfig.java index 4a4d787b5f8..bab6a4231f4 100644 --- a/src/main/java/com/google/genai/types/ListCachedContentsConfig.java +++ b/src/main/java/com/google/genai/types/ListCachedContentsConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearPageToken() { /** Deserializes a JSON string to a ListCachedContentsConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListCachedContentsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListCachedContentsConfig.class); + return Common.fromJsonString(jsonString, ListCachedContentsConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListCachedContentsParameters.java b/src/main/java/com/google/genai/types/ListCachedContentsParameters.java index 6bdd8e5b0df..86a3d58dc9c 100644 --- a/src/main/java/com/google/genai/types/ListCachedContentsParameters.java +++ b/src/main/java/com/google/genai/types/ListCachedContentsParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -90,6 +91,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListCachedContentsParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListCachedContentsParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListCachedContentsParameters.class); + return Common.fromJsonString(jsonString, ListCachedContentsParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListCachedContentsResponse.java b/src/main/java/com/google/genai/types/ListCachedContentsResponse.java index 760252358a3..b58e532ccdc 100644 --- a/src/main/java/com/google/genai/types/ListCachedContentsResponse.java +++ b/src/main/java/com/google/genai/types/ListCachedContentsResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -157,6 +158,6 @@ public Builder clearCachedContents() { /** Deserializes a JSON string to a ListCachedContentsResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListCachedContentsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListCachedContentsResponse.class); + return Common.fromJsonString(jsonString, ListCachedContentsResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListDocumentsConfig.java b/src/main/java/com/google/genai/types/ListDocumentsConfig.java index 3c9a1d99771..1b41f9b2ba0 100644 --- a/src/main/java/com/google/genai/types/ListDocumentsConfig.java +++ b/src/main/java/com/google/genai/types/ListDocumentsConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearPageToken() { /** Deserializes a JSON string to a ListDocumentsConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListDocumentsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListDocumentsConfig.class); + return Common.fromJsonString(jsonString, ListDocumentsConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListDocumentsParameters.java b/src/main/java/com/google/genai/types/ListDocumentsParameters.java index 6aff4017206..ec2b9124bfe 100644 --- a/src/main/java/com/google/genai/types/ListDocumentsParameters.java +++ b/src/main/java/com/google/genai/types/ListDocumentsParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -111,6 +112,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListDocumentsParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListDocumentsParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListDocumentsParameters.class); + return Common.fromJsonString(jsonString, ListDocumentsParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListDocumentsResponse.java b/src/main/java/com/google/genai/types/ListDocumentsResponse.java index 08251b574c9..da8fa15f965 100644 --- a/src/main/java/com/google/genai/types/ListDocumentsResponse.java +++ b/src/main/java/com/google/genai/types/ListDocumentsResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -161,6 +162,6 @@ public Builder clearDocuments() { /** Deserializes a JSON string to a ListDocumentsResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListDocumentsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListDocumentsResponse.class); + return Common.fromJsonString(jsonString, ListDocumentsResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListFileSearchStoresConfig.java b/src/main/java/com/google/genai/types/ListFileSearchStoresConfig.java index 48f035ea4e8..1919c95b92f 100644 --- a/src/main/java/com/google/genai/types/ListFileSearchStoresConfig.java +++ b/src/main/java/com/google/genai/types/ListFileSearchStoresConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearPageToken() { /** Deserializes a JSON string to a ListFileSearchStoresConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListFileSearchStoresConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFileSearchStoresConfig.class); + return Common.fromJsonString(jsonString, ListFileSearchStoresConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListFileSearchStoresParameters.java b/src/main/java/com/google/genai/types/ListFileSearchStoresParameters.java index 1108d9d170e..35fd84f4d29 100644 --- a/src/main/java/com/google/genai/types/ListFileSearchStoresParameters.java +++ b/src/main/java/com/google/genai/types/ListFileSearchStoresParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -90,6 +91,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListFileSearchStoresParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListFileSearchStoresParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFileSearchStoresParameters.class); + return Common.fromJsonString(jsonString, ListFileSearchStoresParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListFileSearchStoresResponse.java b/src/main/java/com/google/genai/types/ListFileSearchStoresResponse.java index e1478d26658..d79582667ec 100644 --- a/src/main/java/com/google/genai/types/ListFileSearchStoresResponse.java +++ b/src/main/java/com/google/genai/types/ListFileSearchStoresResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearFileSearchStores() { /** Deserializes a JSON string to a ListFileSearchStoresResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListFileSearchStoresResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFileSearchStoresResponse.class); + return Common.fromJsonString(jsonString, ListFileSearchStoresResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListFilesConfig.java b/src/main/java/com/google/genai/types/ListFilesConfig.java index 549224b4db6..a4bea45e77d 100644 --- a/src/main/java/com/google/genai/types/ListFilesConfig.java +++ b/src/main/java/com/google/genai/types/ListFilesConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearPageToken() { /** Deserializes a JSON string to a ListFilesConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListFilesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFilesConfig.class); + return Common.fromJsonString(jsonString, ListFilesConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListFilesParameters.java b/src/main/java/com/google/genai/types/ListFilesParameters.java index d62a6d1a1c5..8e0a29ecc0c 100644 --- a/src/main/java/com/google/genai/types/ListFilesParameters.java +++ b/src/main/java/com/google/genai/types/ListFilesParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListFilesParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListFilesParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFilesParameters.class); + return Common.fromJsonString(jsonString, ListFilesParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListFilesResponse.java b/src/main/java/com/google/genai/types/ListFilesResponse.java index 6652239aa7e..86c3eafd6c7 100644 --- a/src/main/java/com/google/genai/types/ListFilesResponse.java +++ b/src/main/java/com/google/genai/types/ListFilesResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -158,6 +159,6 @@ public Builder clearFiles() { /** Deserializes a JSON string to a ListFilesResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListFilesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListFilesResponse.class); + return Common.fromJsonString(jsonString, ListFilesResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListModelsConfig.java b/src/main/java/com/google/genai/types/ListModelsConfig.java index 1b9f4f351d0..a96c78834b4 100644 --- a/src/main/java/com/google/genai/types/ListModelsConfig.java +++ b/src/main/java/com/google/genai/types/ListModelsConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -174,6 +175,6 @@ public Builder clearQueryBase() { /** Deserializes a JSON string to a ListModelsConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListModelsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListModelsConfig.class); + return Common.fromJsonString(jsonString, ListModelsConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListModelsParameters.java b/src/main/java/com/google/genai/types/ListModelsParameters.java index b7b15872e63..b8a834ae5cb 100644 --- a/src/main/java/com/google/genai/types/ListModelsParameters.java +++ b/src/main/java/com/google/genai/types/ListModelsParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListModelsParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListModelsParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListModelsParameters.class); + return Common.fromJsonString(jsonString, ListModelsParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListModelsResponse.java b/src/main/java/com/google/genai/types/ListModelsResponse.java index 05803e7c4a9..adade6e9295 100644 --- a/src/main/java/com/google/genai/types/ListModelsResponse.java +++ b/src/main/java/com/google/genai/types/ListModelsResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -157,6 +158,6 @@ public Builder clearModels() { /** Deserializes a JSON string to a ListModelsResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListModelsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListModelsResponse.class); + return Common.fromJsonString(jsonString, ListModelsResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ListTuningJobsConfig.java b/src/main/java/com/google/genai/types/ListTuningJobsConfig.java index e7b49f586ca..197a799e8ca 100644 --- a/src/main/java/com/google/genai/types/ListTuningJobsConfig.java +++ b/src/main/java/com/google/genai/types/ListTuningJobsConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -152,6 +153,6 @@ public Builder clearFilter() { /** Deserializes a JSON string to a ListTuningJobsConfig object. */ @ExcludeFromGeneratedCoverageReport public static ListTuningJobsConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListTuningJobsConfig.class); + return Common.fromJsonString(jsonString, ListTuningJobsConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ListTuningJobsParameters.java b/src/main/java/com/google/genai/types/ListTuningJobsParameters.java index 429ebccd36b..9504d0d0293 100644 --- a/src/main/java/com/google/genai/types/ListTuningJobsParameters.java +++ b/src/main/java/com/google/genai/types/ListTuningJobsParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a ListTuningJobsParameters object. */ @ExcludeFromGeneratedCoverageReport public static ListTuningJobsParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListTuningJobsParameters.class); + return Common.fromJsonString(jsonString, ListTuningJobsParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ListTuningJobsResponse.java b/src/main/java/com/google/genai/types/ListTuningJobsResponse.java index 2c195aabe40..1c914ccae7a 100644 --- a/src/main/java/com/google/genai/types/ListTuningJobsResponse.java +++ b/src/main/java/com/google/genai/types/ListTuningJobsResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -161,6 +162,6 @@ public Builder clearTuningJobs() { /** Deserializes a JSON string to a ListTuningJobsResponse object. */ @ExcludeFromGeneratedCoverageReport public static ListTuningJobsResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ListTuningJobsResponse.class); + return Common.fromJsonString(jsonString, ListTuningJobsResponse.class); } } diff --git a/src/main/java/com/google/genai/types/LiveClientContent.java b/src/main/java/com/google/genai/types/LiveClientContent.java index 2940c18f605..424f45fee47 100644 --- a/src/main/java/com/google/genai/types/LiveClientContent.java +++ b/src/main/java/com/google/genai/types/LiveClientContent.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -152,6 +153,6 @@ public Builder clearTurnComplete() { /** Deserializes a JSON string to a LiveClientContent object. */ @ExcludeFromGeneratedCoverageReport public static LiveClientContent fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveClientContent.class); + return Common.fromJsonString(jsonString, LiveClientContent.class); } } diff --git a/src/main/java/com/google/genai/types/LiveClientMessage.java b/src/main/java/com/google/genai/types/LiveClientMessage.java index 9a0d946c8ce..e352a228e76 100644 --- a/src/main/java/com/google/genai/types/LiveClientMessage.java +++ b/src/main/java/com/google/genai/types/LiveClientMessage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -230,6 +231,6 @@ public Builder clearToolResponse() { /** Deserializes a JSON string to a LiveClientMessage object. */ @ExcludeFromGeneratedCoverageReport public static LiveClientMessage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveClientMessage.class); + return Common.fromJsonString(jsonString, LiveClientMessage.class); } } diff --git a/src/main/java/com/google/genai/types/LiveClientRealtimeInput.java b/src/main/java/com/google/genai/types/LiveClientRealtimeInput.java index 4c7bb57fb0e..6332a65634c 100644 --- a/src/main/java/com/google/genai/types/LiveClientRealtimeInput.java +++ b/src/main/java/com/google/genai/types/LiveClientRealtimeInput.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -300,6 +301,6 @@ public Builder clearActivityEnd() { /** Deserializes a JSON string to a LiveClientRealtimeInput object. */ @ExcludeFromGeneratedCoverageReport public static LiveClientRealtimeInput fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveClientRealtimeInput.class); + return Common.fromJsonString(jsonString, LiveClientRealtimeInput.class); } } diff --git a/src/main/java/com/google/genai/types/LiveClientSetup.java b/src/main/java/com/google/genai/types/LiveClientSetup.java index 49ca51e6cb4..78a40f0cf70 100644 --- a/src/main/java/com/google/genai/types/LiveClientSetup.java +++ b/src/main/java/com/google/genai/types/LiveClientSetup.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -574,6 +575,6 @@ public Builder clearHistoryConfig() { /** Deserializes a JSON string to a LiveClientSetup object. */ @ExcludeFromGeneratedCoverageReport public static LiveClientSetup fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveClientSetup.class); + return Common.fromJsonString(jsonString, LiveClientSetup.class); } } diff --git a/src/main/java/com/google/genai/types/LiveClientToolResponse.java b/src/main/java/com/google/genai/types/LiveClientToolResponse.java index 17a65bad831..0ee0eb2bc8d 100644 --- a/src/main/java/com/google/genai/types/LiveClientToolResponse.java +++ b/src/main/java/com/google/genai/types/LiveClientToolResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -112,6 +113,6 @@ public Builder clearFunctionResponses() { /** Deserializes a JSON string to a LiveClientToolResponse object. */ @ExcludeFromGeneratedCoverageReport public static LiveClientToolResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveClientToolResponse.class); + return Common.fromJsonString(jsonString, LiveClientToolResponse.class); } } diff --git a/src/main/java/com/google/genai/types/LiveConnectConfig.java b/src/main/java/com/google/genai/types/LiveConnectConfig.java index f10d8d03275..72ee579eeda 100644 --- a/src/main/java/com/google/genai/types/LiveConnectConfig.java +++ b/src/main/java/com/google/genai/types/LiveConnectConfig.java @@ -26,6 +26,7 @@ import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -904,6 +905,6 @@ public Builder clearTranslationConfig() { /** Deserializes a JSON string to a LiveConnectConfig object. */ @ExcludeFromGeneratedCoverageReport public static LiveConnectConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveConnectConfig.class); + return Common.fromJsonString(jsonString, LiveConnectConfig.class); } } diff --git a/src/main/java/com/google/genai/types/LiveConnectConstraints.java b/src/main/java/com/google/genai/types/LiveConnectConstraints.java index 3186e6dea5d..fd23b3cbfb5 100644 --- a/src/main/java/com/google/genai/types/LiveConnectConstraints.java +++ b/src/main/java/com/google/genai/types/LiveConnectConstraints.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a LiveConnectConstraints object. */ @ExcludeFromGeneratedCoverageReport public static LiveConnectConstraints fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveConnectConstraints.class); + return Common.fromJsonString(jsonString, LiveConnectConstraints.class); } } diff --git a/src/main/java/com/google/genai/types/LiveConnectParameters.java b/src/main/java/com/google/genai/types/LiveConnectParameters.java index 037bb44af97..f1f9c841364 100644 --- a/src/main/java/com/google/genai/types/LiveConnectParameters.java +++ b/src/main/java/com/google/genai/types/LiveConnectParameters.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a LiveConnectParameters object. */ @ExcludeFromGeneratedCoverageReport public static LiveConnectParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveConnectParameters.class); + return Common.fromJsonString(jsonString, LiveConnectParameters.class); } } diff --git a/src/main/java/com/google/genai/types/LiveSendClientContentParameters.java b/src/main/java/com/google/genai/types/LiveSendClientContentParameters.java index 873fe1a3f6c..cb5880340cb 100644 --- a/src/main/java/com/google/genai/types/LiveSendClientContentParameters.java +++ b/src/main/java/com/google/genai/types/LiveSendClientContentParameters.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -133,6 +134,6 @@ public Builder clearTurnComplete() { /** Deserializes a JSON string to a LiveSendClientContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static LiveSendClientContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveSendClientContentParameters.class); + return Common.fromJsonString(jsonString, LiveSendClientContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/LiveSendRealtimeInputParameters.java b/src/main/java/com/google/genai/types/LiveSendRealtimeInputParameters.java index e4c81106676..80414eee423 100644 --- a/src/main/java/com/google/genai/types/LiveSendRealtimeInputParameters.java +++ b/src/main/java/com/google/genai/types/LiveSendRealtimeInputParameters.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -273,6 +274,6 @@ public Builder clearActivityEnd() { /** Deserializes a JSON string to a LiveSendRealtimeInputParameters object. */ @ExcludeFromGeneratedCoverageReport public static LiveSendRealtimeInputParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveSendRealtimeInputParameters.class); + return Common.fromJsonString(jsonString, LiveSendRealtimeInputParameters.class); } } diff --git a/src/main/java/com/google/genai/types/LiveSendToolResponseParameters.java b/src/main/java/com/google/genai/types/LiveSendToolResponseParameters.java index a4d4ba38275..dc1ee526aa2 100644 --- a/src/main/java/com/google/genai/types/LiveSendToolResponseParameters.java +++ b/src/main/java/com/google/genai/types/LiveSendToolResponseParameters.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -105,6 +106,6 @@ public Builder clearFunctionResponses() { /** Deserializes a JSON string to a LiveSendToolResponseParameters object. */ @ExcludeFromGeneratedCoverageReport public static LiveSendToolResponseParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveSendToolResponseParameters.class); + return Common.fromJsonString(jsonString, LiveSendToolResponseParameters.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerContent.java b/src/main/java/com/google/genai/types/LiveServerContent.java index 02b4913cd3d..f39748a0f5d 100644 --- a/src/main/java/com/google/genai/types/LiveServerContent.java +++ b/src/main/java/com/google/genai/types/LiveServerContent.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -422,6 +423,6 @@ public Builder clearInterimInputTranscription() { /** Deserializes a JSON string to a LiveServerContent object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerContent fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerContent.class); + return Common.fromJsonString(jsonString, LiveServerContent.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerGoAway.java b/src/main/java/com/google/genai/types/LiveServerGoAway.java index 0ab66898156..b6bcb85ace4 100644 --- a/src/main/java/com/google/genai/types/LiveServerGoAway.java +++ b/src/main/java/com/google/genai/types/LiveServerGoAway.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Optional; @@ -82,6 +83,6 @@ public Builder clearTimeLeft() { /** Deserializes a JSON string to a LiveServerGoAway object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerGoAway fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerGoAway.class); + return Common.fromJsonString(jsonString, LiveServerGoAway.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerMessage.java b/src/main/java/com/google/genai/types/LiveServerMessage.java index 2bbf3666be0..173699be057 100644 --- a/src/main/java/com/google/genai/types/LiveServerMessage.java +++ b/src/main/java/com/google/genai/types/LiveServerMessage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -363,6 +364,6 @@ public Builder clearVoiceActivity() { /** Deserializes a JSON string to a LiveServerMessage object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerMessage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerMessage.class); + return Common.fromJsonString(jsonString, LiveServerMessage.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerSessionResumptionUpdate.java b/src/main/java/com/google/genai/types/LiveServerSessionResumptionUpdate.java index 0c7d34fe885..c8e6877c254 100644 --- a/src/main/java/com/google/genai/types/LiveServerSessionResumptionUpdate.java +++ b/src/main/java/com/google/genai/types/LiveServerSessionResumptionUpdate.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -160,6 +161,6 @@ public Builder clearLastConsumedClientMessageIndex() { /** Deserializes a JSON string to a LiveServerSessionResumptionUpdate object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerSessionResumptionUpdate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerSessionResumptionUpdate.class); + return Common.fromJsonString(jsonString, LiveServerSessionResumptionUpdate.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerSetupComplete.java b/src/main/java/com/google/genai/types/LiveServerSetupComplete.java index 516487a0e6d..cea40a4b137 100644 --- a/src/main/java/com/google/genai/types/LiveServerSetupComplete.java +++ b/src/main/java/com/google/genai/types/LiveServerSetupComplete.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -119,6 +120,6 @@ public Builder clearVoiceConsentSignature() { /** Deserializes a JSON string to a LiveServerSetupComplete object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerSetupComplete fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerSetupComplete.class); + return Common.fromJsonString(jsonString, LiveServerSetupComplete.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerToolCall.java b/src/main/java/com/google/genai/types/LiveServerToolCall.java index e1dd515a4dd..70d2d2b2892 100644 --- a/src/main/java/com/google/genai/types/LiveServerToolCall.java +++ b/src/main/java/com/google/genai/types/LiveServerToolCall.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -106,6 +107,6 @@ public Builder clearFunctionCalls() { /** Deserializes a JSON string to a LiveServerToolCall object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerToolCall fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerToolCall.class); + return Common.fromJsonString(jsonString, LiveServerToolCall.class); } } diff --git a/src/main/java/com/google/genai/types/LiveServerToolCallCancellation.java b/src/main/java/com/google/genai/types/LiveServerToolCallCancellation.java index 81c26a620ff..5c87c5a956a 100644 --- a/src/main/java/com/google/genai/types/LiveServerToolCallCancellation.java +++ b/src/main/java/com/google/genai/types/LiveServerToolCallCancellation.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -96,6 +97,6 @@ public Builder clearIds() { /** Deserializes a JSON string to a LiveServerToolCallCancellation object. */ @ExcludeFromGeneratedCoverageReport public static LiveServerToolCallCancellation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LiveServerToolCallCancellation.class); + return Common.fromJsonString(jsonString, LiveServerToolCallCancellation.class); } } diff --git a/src/main/java/com/google/genai/types/LogprobsResult.java b/src/main/java/com/google/genai/types/LogprobsResult.java index 1f28cf76ced..41bd7b4d43b 100644 --- a/src/main/java/com/google/genai/types/LogprobsResult.java +++ b/src/main/java/com/google/genai/types/LogprobsResult.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -193,6 +194,6 @@ public Builder clearLogProbabilitySum() { /** Deserializes a JSON string to a LogprobsResult object. */ @ExcludeFromGeneratedCoverageReport public static LogprobsResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LogprobsResult.class); + return Common.fromJsonString(jsonString, LogprobsResult.class); } } diff --git a/src/main/java/com/google/genai/types/LogprobsResultCandidate.java b/src/main/java/com/google/genai/types/LogprobsResultCandidate.java index 26795bb5911..62977e87df8 100644 --- a/src/main/java/com/google/genai/types/LogprobsResultCandidate.java +++ b/src/main/java/com/google/genai/types/LogprobsResultCandidate.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -133,6 +134,6 @@ public Builder clearTokenId() { /** Deserializes a JSON string to a LogprobsResultCandidate object. */ @ExcludeFromGeneratedCoverageReport public static LogprobsResultCandidate fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LogprobsResultCandidate.class); + return Common.fromJsonString(jsonString, LogprobsResultCandidate.class); } } diff --git a/src/main/java/com/google/genai/types/LogprobsResultTopCandidates.java b/src/main/java/com/google/genai/types/LogprobsResultTopCandidates.java index 4cde4885e0f..66160c84cb3 100644 --- a/src/main/java/com/google/genai/types/LogprobsResultTopCandidates.java +++ b/src/main/java/com/google/genai/types/LogprobsResultTopCandidates.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -106,6 +107,6 @@ public Builder clearCandidates() { /** Deserializes a JSON string to a LogprobsResultTopCandidates object. */ @ExcludeFromGeneratedCoverageReport public static LogprobsResultTopCandidates fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, LogprobsResultTopCandidates.class); + return Common.fromJsonString(jsonString, LogprobsResultTopCandidates.class); } } diff --git a/src/main/java/com/google/genai/types/MaskReferenceConfig.java b/src/main/java/com/google/genai/types/MaskReferenceConfig.java index c4f7ae7bd46..01b0f579cdc 100644 --- a/src/main/java/com/google/genai/types/MaskReferenceConfig.java +++ b/src/main/java/com/google/genai/types/MaskReferenceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -163,6 +164,6 @@ public Builder clearMaskDilation() { /** Deserializes a JSON string to a MaskReferenceConfig object. */ @ExcludeFromGeneratedCoverageReport public static MaskReferenceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MaskReferenceConfig.class); + return Common.fromJsonString(jsonString, MaskReferenceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/MaskReferenceImage.java b/src/main/java/com/google/genai/types/MaskReferenceImage.java index c40becbb22c..9920ceee34c 100644 --- a/src/main/java/com/google/genai/types/MaskReferenceImage.java +++ b/src/main/java/com/google/genai/types/MaskReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -170,7 +171,7 @@ public Builder clearConfig() { /** Deserializes a JSON string to a MaskReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static MaskReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MaskReferenceImage.class); + return Common.fromJsonString(jsonString, MaskReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/McpServer.java b/src/main/java/com/google/genai/types/McpServer.java index 04b7ad5c61f..0e336e35e34 100644 --- a/src/main/java/com/google/genai/types/McpServer.java +++ b/src/main/java/com/google/genai/types/McpServer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -114,6 +115,6 @@ public Builder clearStreamableHttpTransport() { /** Deserializes a JSON string to a McpServer object. */ @ExcludeFromGeneratedCoverageReport public static McpServer fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, McpServer.class); + return Common.fromJsonString(jsonString, McpServer.class); } } diff --git a/src/main/java/com/google/genai/types/Metric.java b/src/main/java/com/google/genai/types/Metric.java index a9e047e700b..ebf517cf516 100644 --- a/src/main/java/com/google/genai/types/Metric.java +++ b/src/main/java/com/google/genai/types/Metric.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -142,6 +143,6 @@ public Builder clearReturnRawOutput() { /** Deserializes a JSON string to a Metric object. */ @ExcludeFromGeneratedCoverageReport public static Metric fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Metric.class); + return Common.fromJsonString(jsonString, Metric.class); } } diff --git a/src/main/java/com/google/genai/types/ModalityTokenCount.java b/src/main/java/com/google/genai/types/ModalityTokenCount.java index 8f3cf57f8ce..073eda840ab 100644 --- a/src/main/java/com/google/genai/types/ModalityTokenCount.java +++ b/src/main/java/com/google/genai/types/ModalityTokenCount.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -124,6 +125,6 @@ public Builder clearTokenCount() { /** Deserializes a JSON string to a ModalityTokenCount object. */ @ExcludeFromGeneratedCoverageReport public static ModalityTokenCount fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ModalityTokenCount.class); + return Common.fromJsonString(jsonString, ModalityTokenCount.class); } } diff --git a/src/main/java/com/google/genai/types/Model.java b/src/main/java/com/google/genai/types/Model.java index df19f5a8a02..dc9b86c5a20 100644 --- a/src/main/java/com/google/genai/types/Model.java +++ b/src/main/java/com/google/genai/types/Model.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -541,6 +542,6 @@ public Builder clearThinking() { /** Deserializes a JSON string to a Model object. */ @ExcludeFromGeneratedCoverageReport public static Model fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Model.class); + return Common.fromJsonString(jsonString, Model.class); } } diff --git a/src/main/java/com/google/genai/types/ModelArmorConfig.java b/src/main/java/com/google/genai/types/ModelArmorConfig.java index 72d3fdeedb3..86f96d119b3 100644 --- a/src/main/java/com/google/genai/types/ModelArmorConfig.java +++ b/src/main/java/com/google/genai/types/ModelArmorConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -124,6 +125,6 @@ public Builder clearResponseTemplateName() { /** Deserializes a JSON string to a ModelArmorConfig object. */ @ExcludeFromGeneratedCoverageReport public static ModelArmorConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ModelArmorConfig.class); + return Common.fromJsonString(jsonString, ModelArmorConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ModelSelectionConfig.java b/src/main/java/com/google/genai/types/ModelSelectionConfig.java index c9cf9bc96a7..06be169bc37 100644 --- a/src/main/java/com/google/genai/types/ModelSelectionConfig.java +++ b/src/main/java/com/google/genai/types/ModelSelectionConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder featureSelectionPreference(String featureSelectionPreference) { /** Deserializes a JSON string to a ModelSelectionConfig object. */ @ExcludeFromGeneratedCoverageReport public static ModelSelectionConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ModelSelectionConfig.class); + return Common.fromJsonString(jsonString, ModelSelectionConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ModelStatus.java b/src/main/java/com/google/genai/types/ModelStatus.java index faffa432165..e9d9cce5d41 100644 --- a/src/main/java/com/google/genai/types/ModelStatus.java +++ b/src/main/java/com/google/genai/types/ModelStatus.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -144,6 +145,6 @@ public Builder clearRetirementTime() { /** Deserializes a JSON string to a ModelStatus object. */ @ExcludeFromGeneratedCoverageReport public static ModelStatus fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ModelStatus.class); + return Common.fromJsonString(jsonString, ModelStatus.class); } } diff --git a/src/main/java/com/google/genai/types/MultiSpeakerVoiceConfig.java b/src/main/java/com/google/genai/types/MultiSpeakerVoiceConfig.java index 76a3876d6cb..e3c1e1f7ca9 100644 --- a/src/main/java/com/google/genai/types/MultiSpeakerVoiceConfig.java +++ b/src/main/java/com/google/genai/types/MultiSpeakerVoiceConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -109,6 +110,6 @@ public Builder clearSpeakerVoiceConfigs() { /** Deserializes a JSON string to a MultiSpeakerVoiceConfig object. */ @ExcludeFromGeneratedCoverageReport public static MultiSpeakerVoiceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, MultiSpeakerVoiceConfig.class); + return Common.fromJsonString(jsonString, MultiSpeakerVoiceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/OutputConfig.java b/src/main/java/com/google/genai/types/OutputConfig.java index 704cedba096..6944c827488 100644 --- a/src/main/java/com/google/genai/types/OutputConfig.java +++ b/src/main/java/com/google/genai/types/OutputConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearGcsDestination() { /** Deserializes a JSON string to a OutputConfig object. */ @ExcludeFromGeneratedCoverageReport public static OutputConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, OutputConfig.class); + return Common.fromJsonString(jsonString, OutputConfig.class); } } diff --git a/src/main/java/com/google/genai/types/OutputInfo.java b/src/main/java/com/google/genai/types/OutputInfo.java index dd081b44a3e..6a6947d77e3 100644 --- a/src/main/java/com/google/genai/types/OutputInfo.java +++ b/src/main/java/com/google/genai/types/OutputInfo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -83,6 +84,6 @@ public Builder clearGcsOutputDirectory() { /** Deserializes a JSON string to a OutputInfo object. */ @ExcludeFromGeneratedCoverageReport public static OutputInfo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, OutputInfo.class); + return Common.fromJsonString(jsonString, OutputInfo.class); } } diff --git a/src/main/java/com/google/genai/types/PairwiseMetricResult.java b/src/main/java/com/google/genai/types/PairwiseMetricResult.java index 1141df76286..59008b27306 100644 --- a/src/main/java/com/google/genai/types/PairwiseMetricResult.java +++ b/src/main/java/com/google/genai/types/PairwiseMetricResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -150,6 +151,6 @@ public Builder pairwiseChoice(String pairwiseChoice) { /** Deserializes a JSON string to a PairwiseMetricResult object. */ @ExcludeFromGeneratedCoverageReport public static PairwiseMetricResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PairwiseMetricResult.class); + return Common.fromJsonString(jsonString, PairwiseMetricResult.class); } } diff --git a/src/main/java/com/google/genai/types/PairwiseMetricSpec.java b/src/main/java/com/google/genai/types/PairwiseMetricSpec.java index 9eb04f3e6dd..491db46f4b2 100644 --- a/src/main/java/com/google/genai/types/PairwiseMetricSpec.java +++ b/src/main/java/com/google/genai/types/PairwiseMetricSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -188,6 +189,6 @@ public Builder clearSystemInstruction() { /** Deserializes a JSON string to a PairwiseMetricSpec object. */ @ExcludeFromGeneratedCoverageReport public static PairwiseMetricSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PairwiseMetricSpec.class); + return Common.fromJsonString(jsonString, PairwiseMetricSpec.class); } } diff --git a/src/main/java/com/google/genai/types/Part.java b/src/main/java/com/google/genai/types/Part.java index f9f3b41b6f8..e5bb6658139 100644 --- a/src/main/java/com/google/genai/types/Part.java +++ b/src/main/java/com/google/genai/types/Part.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -553,7 +554,7 @@ public Builder clearAudioTranscription() { /** Deserializes a JSON string to a Part object. */ @ExcludeFromGeneratedCoverageReport public static Part fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Part.class); + return Common.fromJsonString(jsonString, Part.class); } /** Constructs a Text Part from a text string. */ diff --git a/src/main/java/com/google/genai/types/PartMediaResolution.java b/src/main/java/com/google/genai/types/PartMediaResolution.java index 1fb11faf7c9..5199a92d069 100644 --- a/src/main/java/com/google/genai/types/PartMediaResolution.java +++ b/src/main/java/com/google/genai/types/PartMediaResolution.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -118,6 +119,6 @@ public Builder clearNumTokens() { /** Deserializes a JSON string to a PartMediaResolution object. */ @ExcludeFromGeneratedCoverageReport public static PartMediaResolution fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PartMediaResolution.class); + return Common.fromJsonString(jsonString, PartMediaResolution.class); } } diff --git a/src/main/java/com/google/genai/types/PartialArg.java b/src/main/java/com/google/genai/types/PartialArg.java index e6a8b6f6462..e8f3bf19238 100644 --- a/src/main/java/com/google/genai/types/PartialArg.java +++ b/src/main/java/com/google/genai/types/PartialArg.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -214,6 +215,6 @@ public Builder clearWillContinue() { /** Deserializes a JSON string to a PartialArg object. */ @ExcludeFromGeneratedCoverageReport public static PartialArg fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PartialArg.class); + return Common.fromJsonString(jsonString, PartialArg.class); } } diff --git a/src/main/java/com/google/genai/types/PartnerModelTuningSpec.java b/src/main/java/com/google/genai/types/PartnerModelTuningSpec.java index f939075a64f..45ac20be3aa 100644 --- a/src/main/java/com/google/genai/types/PartnerModelTuningSpec.java +++ b/src/main/java/com/google/genai/types/PartnerModelTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -133,6 +134,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a PartnerModelTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static PartnerModelTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PartnerModelTuningSpec.class); + return Common.fromJsonString(jsonString, PartnerModelTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/PointwiseMetricResult.java b/src/main/java/com/google/genai/types/PointwiseMetricResult.java index e8422380894..8a3ed32f3b8 100644 --- a/src/main/java/com/google/genai/types/PointwiseMetricResult.java +++ b/src/main/java/com/google/genai/types/PointwiseMetricResult.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a PointwiseMetricResult object. */ @ExcludeFromGeneratedCoverageReport public static PointwiseMetricResult fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PointwiseMetricResult.class); + return Common.fromJsonString(jsonString, PointwiseMetricResult.class); } } diff --git a/src/main/java/com/google/genai/types/PointwiseMetricSpec.java b/src/main/java/com/google/genai/types/PointwiseMetricSpec.java index e5560b770d7..8dfb554c034 100644 --- a/src/main/java/com/google/genai/types/PointwiseMetricSpec.java +++ b/src/main/java/com/google/genai/types/PointwiseMetricSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -147,6 +148,6 @@ public Builder clearSystemInstruction() { /** Deserializes a JSON string to a PointwiseMetricSpec object. */ @ExcludeFromGeneratedCoverageReport public static PointwiseMetricSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PointwiseMetricSpec.class); + return Common.fromJsonString(jsonString, PointwiseMetricSpec.class); } } diff --git a/src/main/java/com/google/genai/types/PreTunedModel.java b/src/main/java/com/google/genai/types/PreTunedModel.java index 3afbd63f131..772fa2b0035 100644 --- a/src/main/java/com/google/genai/types/PreTunedModel.java +++ b/src/main/java/com/google/genai/types/PreTunedModel.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -130,6 +131,6 @@ public Builder clearTunedModelName() { /** Deserializes a JSON string to a PreTunedModel object. */ @ExcludeFromGeneratedCoverageReport public static PreTunedModel fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PreTunedModel.class); + return Common.fromJsonString(jsonString, PreTunedModel.class); } } diff --git a/src/main/java/com/google/genai/types/PrebuiltVoiceConfig.java b/src/main/java/com/google/genai/types/PrebuiltVoiceConfig.java index 4a6d2073362..dd1de957656 100644 --- a/src/main/java/com/google/genai/types/PrebuiltVoiceConfig.java +++ b/src/main/java/com/google/genai/types/PrebuiltVoiceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearVoiceName() { /** Deserializes a JSON string to a PrebuiltVoiceConfig object. */ @ExcludeFromGeneratedCoverageReport public static PrebuiltVoiceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PrebuiltVoiceConfig.class); + return Common.fromJsonString(jsonString, PrebuiltVoiceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/PredefinedMetricSpec.java b/src/main/java/com/google/genai/types/PredefinedMetricSpec.java index 15a1fbdc97b..97762a2cd43 100644 --- a/src/main/java/com/google/genai/types/PredefinedMetricSpec.java +++ b/src/main/java/com/google/genai/types/PredefinedMetricSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -103,6 +104,6 @@ public Builder clearMetricSpecParameters() { /** Deserializes a JSON string to a PredefinedMetricSpec object. */ @ExcludeFromGeneratedCoverageReport public static PredefinedMetricSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PredefinedMetricSpec.class); + return Common.fromJsonString(jsonString, PredefinedMetricSpec.class); } } diff --git a/src/main/java/com/google/genai/types/PreferenceOptimizationDataStats.java b/src/main/java/com/google/genai/types/PreferenceOptimizationDataStats.java index 1a153804ae5..9bdc1ce5c78 100644 --- a/src/main/java/com/google/genai/types/PreferenceOptimizationDataStats.java +++ b/src/main/java/com/google/genai/types/PreferenceOptimizationDataStats.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -389,6 +390,6 @@ public Builder clearUserOutputTokenDistribution() { /** Deserializes a JSON string to a PreferenceOptimizationDataStats object. */ @ExcludeFromGeneratedCoverageReport public static PreferenceOptimizationDataStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PreferenceOptimizationDataStats.class); + return Common.fromJsonString(jsonString, PreferenceOptimizationDataStats.class); } } diff --git a/src/main/java/com/google/genai/types/PreferenceOptimizationHyperParameters.java b/src/main/java/com/google/genai/types/PreferenceOptimizationHyperParameters.java index a5451be0f6a..c078cc94b9d 100644 --- a/src/main/java/com/google/genai/types/PreferenceOptimizationHyperParameters.java +++ b/src/main/java/com/google/genai/types/PreferenceOptimizationHyperParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -171,6 +172,6 @@ public Builder clearLearningRateMultiplier() { /** Deserializes a JSON string to a PreferenceOptimizationHyperParameters object. */ @ExcludeFromGeneratedCoverageReport public static PreferenceOptimizationHyperParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PreferenceOptimizationHyperParameters.class); + return Common.fromJsonString(jsonString, PreferenceOptimizationHyperParameters.class); } } diff --git a/src/main/java/com/google/genai/types/PreferenceOptimizationSpec.java b/src/main/java/com/google/genai/types/PreferenceOptimizationSpec.java index 288c5e55425..0d525356622 100644 --- a/src/main/java/com/google/genai/types/PreferenceOptimizationSpec.java +++ b/src/main/java/com/google/genai/types/PreferenceOptimizationSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -168,6 +169,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a PreferenceOptimizationSpec object. */ @ExcludeFromGeneratedCoverageReport public static PreferenceOptimizationSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, PreferenceOptimizationSpec.class); + return Common.fromJsonString(jsonString, PreferenceOptimizationSpec.class); } } diff --git a/src/main/java/com/google/genai/types/ProactivityConfig.java b/src/main/java/com/google/genai/types/ProactivityConfig.java index f4d0adcf44b..821063ad6f0 100644 --- a/src/main/java/com/google/genai/types/ProactivityConfig.java +++ b/src/main/java/com/google/genai/types/ProactivityConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -82,6 +83,6 @@ public Builder clearProactiveAudio() { /** Deserializes a JSON string to a ProactivityConfig object. */ @ExcludeFromGeneratedCoverageReport public static ProactivityConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ProactivityConfig.class); + return Common.fromJsonString(jsonString, ProactivityConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ProductImage.java b/src/main/java/com/google/genai/types/ProductImage.java index 0686acbea7b..b9ec304a023 100644 --- a/src/main/java/com/google/genai/types/ProductImage.java +++ b/src/main/java/com/google/genai/types/ProductImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearProductImage() { /** Deserializes a JSON string to a ProductImage object. */ @ExcludeFromGeneratedCoverageReport public static ProductImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ProductImage.class); + return Common.fromJsonString(jsonString, ProductImage.class); } } diff --git a/src/main/java/com/google/genai/types/ProxyOptions.java b/src/main/java/com/google/genai/types/ProxyOptions.java index cfdb237dfea..625b4bfb007 100644 --- a/src/main/java/com/google/genai/types/ProxyOptions.java +++ b/src/main/java/com/google/genai/types/ProxyOptions.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -186,6 +187,6 @@ public Builder clearPassword() { /** Deserializes a JSON string to a ProxyOptions object. */ @ExcludeFromGeneratedCoverageReport public static ProxyOptions fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ProxyOptions.class); + return Common.fromJsonString(jsonString, ProxyOptions.class); } } diff --git a/src/main/java/com/google/genai/types/RagChunk.java b/src/main/java/com/google/genai/types/RagChunk.java index fed311d1910..2eb616aeb89 100644 --- a/src/main/java/com/google/genai/types/RagChunk.java +++ b/src/main/java/com/google/genai/types/RagChunk.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -155,6 +156,6 @@ public Builder clearFileId() { /** Deserializes a JSON string to a RagChunk object. */ @ExcludeFromGeneratedCoverageReport public static RagChunk fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagChunk.class); + return Common.fromJsonString(jsonString, RagChunk.class); } } diff --git a/src/main/java/com/google/genai/types/RagChunkPageSpan.java b/src/main/java/com/google/genai/types/RagChunkPageSpan.java index 35e7291fb87..9aa504c8f50 100644 --- a/src/main/java/com/google/genai/types/RagChunkPageSpan.java +++ b/src/main/java/com/google/genai/types/RagChunkPageSpan.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -101,6 +102,6 @@ public Builder clearLastPage() { /** Deserializes a JSON string to a RagChunkPageSpan object. */ @ExcludeFromGeneratedCoverageReport public static RagChunkPageSpan fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagChunkPageSpan.class); + return Common.fromJsonString(jsonString, RagChunkPageSpan.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfig.java b/src/main/java/com/google/genai/types/RagRetrievalConfig.java index 02730a6feea..7e8d25b1963 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfig.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -172,6 +173,6 @@ public Builder clearTopK() { /** Deserializes a JSON string to a RagRetrievalConfig object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfig.class); + return Common.fromJsonString(jsonString, RagRetrievalConfig.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfigFilter.java b/src/main/java/com/google/genai/types/RagRetrievalConfigFilter.java index 0dedc1a6216..9c490f25ad5 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfigFilter.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfigFilter.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -122,6 +123,6 @@ public Builder clearVectorSimilarityThreshold() { /** Deserializes a JSON string to a RagRetrievalConfigFilter object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfigFilter fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfigFilter.class); + return Common.fromJsonString(jsonString, RagRetrievalConfigFilter.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfigHybridSearch.java b/src/main/java/com/google/genai/types/RagRetrievalConfigHybridSearch.java index 395b261eefb..ba5928525c6 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfigHybridSearch.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfigHybridSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -85,6 +86,6 @@ public Builder clearAlpha() { /** Deserializes a JSON string to a RagRetrievalConfigHybridSearch object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfigHybridSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfigHybridSearch.class); + return Common.fromJsonString(jsonString, RagRetrievalConfigHybridSearch.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfigRanking.java b/src/main/java/com/google/genai/types/RagRetrievalConfigRanking.java index 3a98232fe47..a3a7de1e75a 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfigRanking.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfigRanking.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -118,6 +119,6 @@ public Builder clearRankService() { /** Deserializes a JSON string to a RagRetrievalConfigRanking object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfigRanking fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfigRanking.class); + return Common.fromJsonString(jsonString, RagRetrievalConfigRanking.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfigRankingLlmRanker.java b/src/main/java/com/google/genai/types/RagRetrievalConfigRankingLlmRanker.java index 531f58b7fb7..1f58e262788 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfigRankingLlmRanker.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfigRankingLlmRanker.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -83,6 +84,6 @@ public Builder clearModelName() { /** Deserializes a JSON string to a RagRetrievalConfigRankingLlmRanker object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfigRankingLlmRanker fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfigRankingLlmRanker.class); + return Common.fromJsonString(jsonString, RagRetrievalConfigRankingLlmRanker.class); } } diff --git a/src/main/java/com/google/genai/types/RagRetrievalConfigRankingRankService.java b/src/main/java/com/google/genai/types/RagRetrievalConfigRankingRankService.java index de8285fdde3..2effbe59e06 100644 --- a/src/main/java/com/google/genai/types/RagRetrievalConfigRankingRankService.java +++ b/src/main/java/com/google/genai/types/RagRetrievalConfigRankingRankService.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -80,6 +81,6 @@ public Builder clearModelName() { /** Deserializes a JSON string to a RagRetrievalConfigRankingRankService object. */ @ExcludeFromGeneratedCoverageReport public static RagRetrievalConfigRankingRankService fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RagRetrievalConfigRankingRankService.class); + return Common.fromJsonString(jsonString, RagRetrievalConfigRankingRankService.class); } } diff --git a/src/main/java/com/google/genai/types/RawOutput.java b/src/main/java/com/google/genai/types/RawOutput.java index 89d9ec829bb..d233b7a6d1c 100644 --- a/src/main/java/com/google/genai/types/RawOutput.java +++ b/src/main/java/com/google/genai/types/RawOutput.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -88,6 +89,6 @@ public Builder clearRawOutput() { /** Deserializes a JSON string to a RawOutput object. */ @ExcludeFromGeneratedCoverageReport public static RawOutput fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RawOutput.class); + return Common.fromJsonString(jsonString, RawOutput.class); } } diff --git a/src/main/java/com/google/genai/types/RawReferenceImage.java b/src/main/java/com/google/genai/types/RawReferenceImage.java index 02074960ff3..7e4751a9332 100644 --- a/src/main/java/com/google/genai/types/RawReferenceImage.java +++ b/src/main/java/com/google/genai/types/RawReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -135,7 +136,7 @@ public Builder clearReferenceType() { /** Deserializes a JSON string to a RawReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static RawReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RawReferenceImage.class); + return Common.fromJsonString(jsonString, RawReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/RealtimeInputConfig.java b/src/main/java/com/google/genai/types/RealtimeInputConfig.java index c8e8254f086..0cf8a5a77d3 100644 --- a/src/main/java/com/google/genai/types/RealtimeInputConfig.java +++ b/src/main/java/com/google/genai/types/RealtimeInputConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -182,6 +183,6 @@ public Builder turnCoverage(String turnCoverage) { /** Deserializes a JSON string to a RealtimeInputConfig object. */ @ExcludeFromGeneratedCoverageReport public static RealtimeInputConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RealtimeInputConfig.class); + return Common.fromJsonString(jsonString, RealtimeInputConfig.class); } } diff --git a/src/main/java/com/google/genai/types/RecontextImageConfig.java b/src/main/java/com/google/genai/types/RecontextImageConfig.java index 6be1306a4aa..9881d75b14f 100644 --- a/src/main/java/com/google/genai/types/RecontextImageConfig.java +++ b/src/main/java/com/google/genai/types/RecontextImageConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -374,6 +375,6 @@ public Builder clearLabels() { /** Deserializes a JSON string to a RecontextImageConfig object. */ @ExcludeFromGeneratedCoverageReport public static RecontextImageConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RecontextImageConfig.class); + return Common.fromJsonString(jsonString, RecontextImageConfig.class); } } diff --git a/src/main/java/com/google/genai/types/RecontextImageParameters.java b/src/main/java/com/google/genai/types/RecontextImageParameters.java index 6bb6f7fb566..8e2372e78ec 100644 --- a/src/main/java/com/google/genai/types/RecontextImageParameters.java +++ b/src/main/java/com/google/genai/types/RecontextImageParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -146,6 +147,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a RecontextImageParameters object. */ @ExcludeFromGeneratedCoverageReport public static RecontextImageParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RecontextImageParameters.class); + return Common.fromJsonString(jsonString, RecontextImageParameters.class); } } diff --git a/src/main/java/com/google/genai/types/RecontextImageResponse.java b/src/main/java/com/google/genai/types/RecontextImageResponse.java index 35e5dcfe3a4..0fa73abcf8a 100644 --- a/src/main/java/com/google/genai/types/RecontextImageResponse.java +++ b/src/main/java/com/google/genai/types/RecontextImageResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -103,6 +104,6 @@ public Builder clearGeneratedImages() { /** Deserializes a JSON string to a RecontextImageResponse object. */ @ExcludeFromGeneratedCoverageReport public static RecontextImageResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RecontextImageResponse.class); + return Common.fromJsonString(jsonString, RecontextImageResponse.class); } } diff --git a/src/main/java/com/google/genai/types/RecontextImageSource.java b/src/main/java/com/google/genai/types/RecontextImageSource.java index 05ac7b20a46..330c1ceb418 100644 --- a/src/main/java/com/google/genai/types/RecontextImageSource.java +++ b/src/main/java/com/google/genai/types/RecontextImageSource.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -161,6 +162,6 @@ public Builder clearProductImages() { /** Deserializes a JSON string to a RecontextImageSource object. */ @ExcludeFromGeneratedCoverageReport public static RecontextImageSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RecontextImageSource.class); + return Common.fromJsonString(jsonString, RecontextImageSource.class); } } diff --git a/src/main/java/com/google/genai/types/ReferenceImageAPI.java b/src/main/java/com/google/genai/types/ReferenceImageAPI.java index 904bb8e1c90..a5aee36fe39 100644 --- a/src/main/java/com/google/genai/types/ReferenceImageAPI.java +++ b/src/main/java/com/google/genai/types/ReferenceImageAPI.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -260,6 +261,6 @@ public Builder clearSubjectImageConfig() { /** Deserializes a JSON string to a ReferenceImageAPI object. */ @ExcludeFromGeneratedCoverageReport public static ReferenceImageAPI fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReferenceImageAPI.class); + return Common.fromJsonString(jsonString, ReferenceImageAPI.class); } } diff --git a/src/main/java/com/google/genai/types/RegisterFilesConfig.java b/src/main/java/com/google/genai/types/RegisterFilesConfig.java index d177982bbd9..2ce6c4f567f 100644 --- a/src/main/java/com/google/genai/types/RegisterFilesConfig.java +++ b/src/main/java/com/google/genai/types/RegisterFilesConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -109,6 +110,6 @@ public Builder clearShouldReturnHttpResponse() { /** Deserializes a JSON string to a RegisterFilesConfig object. */ @ExcludeFromGeneratedCoverageReport public static RegisterFilesConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RegisterFilesConfig.class); + return Common.fromJsonString(jsonString, RegisterFilesConfig.class); } } diff --git a/src/main/java/com/google/genai/types/RegisterFilesResponse.java b/src/main/java/com/google/genai/types/RegisterFilesResponse.java index 4afe58fe193..71148383ca8 100644 --- a/src/main/java/com/google/genai/types/RegisterFilesResponse.java +++ b/src/main/java/com/google/genai/types/RegisterFilesResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -135,6 +136,6 @@ public Builder clearFiles() { /** Deserializes a JSON string to a RegisterFilesResponse object. */ @ExcludeFromGeneratedCoverageReport public static RegisterFilesResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RegisterFilesResponse.class); + return Common.fromJsonString(jsonString, RegisterFilesResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorer.java index d125808ab4a..478b8513f7e 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -241,6 +242,6 @@ public Builder clearExactMatchScorer() { /** Deserializes a JSON string to a ReinforcementTuningAutoraterScorer object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningAutoraterScorer fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReinforcementTuningAutoraterScorer.class); + return Common.fromJsonString(jsonString, ReinforcementTuningAutoraterScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerExactMatchScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerExactMatchScorer.java index 1e5042989fb..4b1880094ca 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerExactMatchScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerExactMatchScorer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -150,7 +151,7 @@ public Builder clearExpression() { /** Deserializes a JSON string to a ReinforcementTuningAutoraterScorerExactMatchScorer object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningAutoraterScorerExactMatchScorer fromJson(String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, ReinforcementTuningAutoraterScorerExactMatchScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer.java index 99c5c09acc5..3278fe85ce3 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -68,7 +69,7 @@ private static Builder create() { @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningAutoraterScorerParsedResponseConversionScorer fromJson( String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningCloudRunRewardScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningCloudRunRewardScorer.java index 9d15045ddf9..5f33ea1c55a 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningCloudRunRewardScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningCloudRunRewardScorer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -113,7 +114,6 @@ public Builder clearCloudRunUri() { /** Deserializes a JSON string to a ReinforcementTuningCloudRunRewardScorer object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningCloudRunRewardScorer fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ReinforcementTuningCloudRunRewardScorer.class); + return Common.fromJsonString(jsonString, ReinforcementTuningCloudRunRewardScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningCodeExecutionRewardScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningCodeExecutionRewardScorer.java index 0837c4de176..0d8d8292694 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningCodeExecutionRewardScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningCodeExecutionRewardScorer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -105,7 +106,6 @@ public Builder clearPythonCodeSnippet() { /** Deserializes a JSON string to a ReinforcementTuningCodeExecutionRewardScorer object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningCodeExecutionRewardScorer fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ReinforcementTuningCodeExecutionRewardScorer.class); + return Common.fromJsonString(jsonString, ReinforcementTuningCodeExecutionRewardScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningExample.java b/src/main/java/com/google/genai/types/ReinforcementTuningExample.java index 87015670287..81d1280df6c 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningExample.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningExample.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -183,6 +184,6 @@ public Builder clearSystemInstruction() { /** Deserializes a JSON string to a ReinforcementTuningExample object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningExample fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReinforcementTuningExample.class); + return Common.fromJsonString(jsonString, ReinforcementTuningExample.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningHyperParameters.java b/src/main/java/com/google/genai/types/ReinforcementTuningHyperParameters.java index e94f49c6cc9..65066c462d6 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningHyperParameters.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningHyperParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -355,6 +356,6 @@ public Builder clearThinkingBudget() { /** Deserializes a JSON string to a ReinforcementTuningHyperParameters object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningHyperParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReinforcementTuningHyperParameters.class); + return Common.fromJsonString(jsonString, ReinforcementTuningHyperParameters.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningParseResponseConfig.java b/src/main/java/com/google/genai/types/ReinforcementTuningParseResponseConfig.java index fe2daec2cc6..c42d7e1af70 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningParseResponseConfig.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningParseResponseConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -134,7 +135,6 @@ public Builder clearRegexExtractExpression() { /** Deserializes a JSON string to a ReinforcementTuningParseResponseConfig object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningParseResponseConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ReinforcementTuningParseResponseConfig.class); + return Common.fromJsonString(jsonString, ReinforcementTuningParseResponseConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningSpec.java b/src/main/java/com/google/genai/types/ReinforcementTuningSpec.java index bcbf1aea461..36ad3839e22 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningSpec.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -209,6 +210,6 @@ public Builder clearSingleRewardConfig() { /** Deserializes a JSON string to a ReinforcementTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReinforcementTuningSpec.class); + return Common.fromJsonString(jsonString, ReinforcementTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorer.java b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorer.java index 2502c61f801..c720fa51318 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorer.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -191,7 +192,6 @@ public Builder clearJsonMatchExpression() { /** Deserializes a JSON string to a ReinforcementTuningStringMatchRewardScorer object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningStringMatchRewardScorer fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ReinforcementTuningStringMatchRewardScorer.class); + return Common.fromJsonString(jsonString, ReinforcementTuningStringMatchRewardScorer.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression.java b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression.java index 8b796de5550..421897ca12d 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -137,7 +138,7 @@ public Builder clearValueStringMatchExpression() { @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningStringMatchRewardScorerJsonMatchExpression fromJson( String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, ReinforcementTuningStringMatchRewardScorerJsonMatchExpression.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerStringMatchExpression.java b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerStringMatchExpression.java index 2e007ec91cb..65e3fd7cd67 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerStringMatchExpression.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningStringMatchRewardScorerStringMatchExpression.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -151,7 +152,7 @@ public Builder clearExpression() { @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningStringMatchRewardScorerStringMatchExpression fromJson( String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, ReinforcementTuningStringMatchRewardScorerStringMatchExpression.class); } } diff --git a/src/main/java/com/google/genai/types/ReinforcementTuningUserDatasetExamples.java b/src/main/java/com/google/genai/types/ReinforcementTuningUserDatasetExamples.java index eed16103cf7..9d75175400c 100644 --- a/src/main/java/com/google/genai/types/ReinforcementTuningUserDatasetExamples.java +++ b/src/main/java/com/google/genai/types/ReinforcementTuningUserDatasetExamples.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -112,7 +113,6 @@ public Builder clearUserDatasetExamples() { /** Deserializes a JSON string to a ReinforcementTuningUserDatasetExamples object. */ @ExcludeFromGeneratedCoverageReport public static ReinforcementTuningUserDatasetExamples fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, ReinforcementTuningUserDatasetExamples.class); + return Common.fromJsonString(jsonString, ReinforcementTuningUserDatasetExamples.class); } } diff --git a/src/main/java/com/google/genai/types/ReplayFile.java b/src/main/java/com/google/genai/types/ReplayFile.java index 0ad157da14a..26078c005e8 100644 --- a/src/main/java/com/google/genai/types/ReplayFile.java +++ b/src/main/java/com/google/genai/types/ReplayFile.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -125,6 +126,6 @@ public Builder clearInteractions() { /** Deserializes a JSON string to a ReplayFile object. */ @ExcludeFromGeneratedCoverageReport public static ReplayFile fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReplayFile.class); + return Common.fromJsonString(jsonString, ReplayFile.class); } } diff --git a/src/main/java/com/google/genai/types/ReplayInteraction.java b/src/main/java/com/google/genai/types/ReplayInteraction.java index c1aab824068..4c4deb1795f 100644 --- a/src/main/java/com/google/genai/types/ReplayInteraction.java +++ b/src/main/java/com/google/genai/types/ReplayInteraction.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -118,6 +119,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a ReplayInteraction object. */ @ExcludeFromGeneratedCoverageReport public static ReplayInteraction fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReplayInteraction.class); + return Common.fromJsonString(jsonString, ReplayInteraction.class); } } diff --git a/src/main/java/com/google/genai/types/ReplayRequest.java b/src/main/java/com/google/genai/types/ReplayRequest.java index c4a53506b3e..748d84f2061 100644 --- a/src/main/java/com/google/genai/types/ReplayRequest.java +++ b/src/main/java/com/google/genai/types/ReplayRequest.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -155,6 +156,6 @@ public Builder clearBodySegments() { /** Deserializes a JSON string to a ReplayRequest object. */ @ExcludeFromGeneratedCoverageReport public static ReplayRequest fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReplayRequest.class); + return Common.fromJsonString(jsonString, ReplayRequest.class); } } diff --git a/src/main/java/com/google/genai/types/ReplayResponse.java b/src/main/java/com/google/genai/types/ReplayResponse.java index dfaeb9aaea1..e16916929bb 100644 --- a/src/main/java/com/google/genai/types/ReplayResponse.java +++ b/src/main/java/com/google/genai/types/ReplayResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -165,6 +166,6 @@ public Builder clearSdkResponseSegments() { /** Deserializes a JSON string to a ReplayResponse object. */ @ExcludeFromGeneratedCoverageReport public static ReplayResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReplayResponse.class); + return Common.fromJsonString(jsonString, ReplayResponse.class); } } diff --git a/src/main/java/com/google/genai/types/ReplicatedVoiceConfig.java b/src/main/java/com/google/genai/types/ReplicatedVoiceConfig.java index 7a277091a06..b38a64e09b5 100644 --- a/src/main/java/com/google/genai/types/ReplicatedVoiceConfig.java +++ b/src/main/java/com/google/genai/types/ReplicatedVoiceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -173,6 +174,6 @@ public Builder clearVoiceConsentSignature() { /** Deserializes a JSON string to a ReplicatedVoiceConfig object. */ @ExcludeFromGeneratedCoverageReport public static ReplicatedVoiceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ReplicatedVoiceConfig.class); + return Common.fromJsonString(jsonString, ReplicatedVoiceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ResponseFormat.java b/src/main/java/com/google/genai/types/ResponseFormat.java index 5b986fbf9c4..1896541c95b 100644 --- a/src/main/java/com/google/genai/types/ResponseFormat.java +++ b/src/main/java/com/google/genai/types/ResponseFormat.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -185,6 +186,6 @@ public Builder clearVideo() { /** Deserializes a JSON string to a ResponseFormat object. */ @ExcludeFromGeneratedCoverageReport public static ResponseFormat fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ResponseFormat.class); + return Common.fromJsonString(jsonString, ResponseFormat.class); } } diff --git a/src/main/java/com/google/genai/types/Retrieval.java b/src/main/java/com/google/genai/types/Retrieval.java index cc027e68d61..2564892877b 100644 --- a/src/main/java/com/google/genai/types/Retrieval.java +++ b/src/main/java/com/google/genai/types/Retrieval.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -180,6 +181,6 @@ public Builder clearVertexRagStore() { /** Deserializes a JSON string to a Retrieval object. */ @ExcludeFromGeneratedCoverageReport public static Retrieval fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Retrieval.class); + return Common.fromJsonString(jsonString, Retrieval.class); } } diff --git a/src/main/java/com/google/genai/types/RetrievalConfig.java b/src/main/java/com/google/genai/types/RetrievalConfig.java index 727b382dcef..0f4d11f4916 100644 --- a/src/main/java/com/google/genai/types/RetrievalConfig.java +++ b/src/main/java/com/google/genai/types/RetrievalConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -108,6 +109,6 @@ public Builder clearLanguageCode() { /** Deserializes a JSON string to a RetrievalConfig object. */ @ExcludeFromGeneratedCoverageReport public static RetrievalConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrievalConfig.class); + return Common.fromJsonString(jsonString, RetrievalConfig.class); } } diff --git a/src/main/java/com/google/genai/types/RetrievalMetadata.java b/src/main/java/com/google/genai/types/RetrievalMetadata.java index 969947a668c..e4445664d1e 100644 --- a/src/main/java/com/google/genai/types/RetrievalMetadata.java +++ b/src/main/java/com/google/genai/types/RetrievalMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -87,6 +88,6 @@ public Builder clearGoogleSearchDynamicRetrievalScore() { /** Deserializes a JSON string to a RetrievalMetadata object. */ @ExcludeFromGeneratedCoverageReport public static RetrievalMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RetrievalMetadata.class); + return Common.fromJsonString(jsonString, RetrievalMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/RougeMetricValue.java b/src/main/java/com/google/genai/types/RougeMetricValue.java index e3fc4265a47..ce29ecd9c4d 100644 --- a/src/main/java/com/google/genai/types/RougeMetricValue.java +++ b/src/main/java/com/google/genai/types/RougeMetricValue.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearScore() { /** Deserializes a JSON string to a RougeMetricValue object. */ @ExcludeFromGeneratedCoverageReport public static RougeMetricValue fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RougeMetricValue.class); + return Common.fromJsonString(jsonString, RougeMetricValue.class); } } diff --git a/src/main/java/com/google/genai/types/RougeSpec.java b/src/main/java/com/google/genai/types/RougeSpec.java index d755457d7fe..5d5c96e2506 100644 --- a/src/main/java/com/google/genai/types/RougeSpec.java +++ b/src/main/java/com/google/genai/types/RougeSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearUseStemmer() { /** Deserializes a JSON string to a RougeSpec object. */ @ExcludeFromGeneratedCoverageReport public static RougeSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RougeSpec.class); + return Common.fromJsonString(jsonString, RougeSpec.class); } } diff --git a/src/main/java/com/google/genai/types/RubricGenerationSpec.java b/src/main/java/com/google/genai/types/RubricGenerationSpec.java index 659ec97330c..772bcba340e 100644 --- a/src/main/java/com/google/genai/types/RubricGenerationSpec.java +++ b/src/main/java/com/google/genai/types/RubricGenerationSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -205,6 +206,6 @@ public Builder clearRubricTypeOntology() { /** Deserializes a JSON string to a RubricGenerationSpec object. */ @ExcludeFromGeneratedCoverageReport public static RubricGenerationSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, RubricGenerationSpec.class); + return Common.fromJsonString(jsonString, RubricGenerationSpec.class); } } diff --git a/src/main/java/com/google/genai/types/SafetyAttributes.java b/src/main/java/com/google/genai/types/SafetyAttributes.java index 62d080b4f85..913bd73f67e 100644 --- a/src/main/java/com/google/genai/types/SafetyAttributes.java +++ b/src/main/java/com/google/genai/types/SafetyAttributes.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -142,6 +143,6 @@ public Builder clearContentType() { /** Deserializes a JSON string to a SafetyAttributes object. */ @ExcludeFromGeneratedCoverageReport public static SafetyAttributes fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SafetyAttributes.class); + return Common.fromJsonString(jsonString, SafetyAttributes.class); } } diff --git a/src/main/java/com/google/genai/types/SafetyRating.java b/src/main/java/com/google/genai/types/SafetyRating.java index eedc1d7b24e..67b2734d769 100644 --- a/src/main/java/com/google/genai/types/SafetyRating.java +++ b/src/main/java/com/google/genai/types/SafetyRating.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -317,6 +318,6 @@ public Builder clearSeverityScore() { /** Deserializes a JSON string to a SafetyRating object. */ @ExcludeFromGeneratedCoverageReport public static SafetyRating fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SafetyRating.class); + return Common.fromJsonString(jsonString, SafetyRating.class); } } diff --git a/src/main/java/com/google/genai/types/SafetySetting.java b/src/main/java/com/google/genai/types/SafetySetting.java index 406b6552eda..1a83a409f14 100644 --- a/src/main/java/com/google/genai/types/SafetySetting.java +++ b/src/main/java/com/google/genai/types/SafetySetting.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -195,6 +196,6 @@ public Builder threshold(String threshold) { /** Deserializes a JSON string to a SafetySetting object. */ @ExcludeFromGeneratedCoverageReport public static SafetySetting fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SafetySetting.class); + return Common.fromJsonString(jsonString, SafetySetting.class); } } diff --git a/src/main/java/com/google/genai/types/Schema.java b/src/main/java/com/google/genai/types/Schema.java index 00942c36459..be896ebd601 100644 --- a/src/main/java/com/google/genai/types/Schema.java +++ b/src/main/java/com/google/genai/types/Schema.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -704,6 +705,6 @@ public Builder type(String type) { /** Deserializes a JSON string to a Schema object. */ @ExcludeFromGeneratedCoverageReport public static Schema fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Schema.class); + return Common.fromJsonString(jsonString, Schema.class); } } diff --git a/src/main/java/com/google/genai/types/ScribbleImage.java b/src/main/java/com/google/genai/types/ScribbleImage.java index 8f7f3f7a001..4b5c3240f42 100644 --- a/src/main/java/com/google/genai/types/ScribbleImage.java +++ b/src/main/java/com/google/genai/types/ScribbleImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -86,6 +87,6 @@ public Builder clearImage() { /** Deserializes a JSON string to a ScribbleImage object. */ @ExcludeFromGeneratedCoverageReport public static ScribbleImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ScribbleImage.class); + return Common.fromJsonString(jsonString, ScribbleImage.class); } } diff --git a/src/main/java/com/google/genai/types/SearchEntryPoint.java b/src/main/java/com/google/genai/types/SearchEntryPoint.java index 7a47d6f456c..00c137dfb29 100644 --- a/src/main/java/com/google/genai/types/SearchEntryPoint.java +++ b/src/main/java/com/google/genai/types/SearchEntryPoint.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -99,6 +100,6 @@ public Builder clearSdkBlob() { /** Deserializes a JSON string to a SearchEntryPoint object. */ @ExcludeFromGeneratedCoverageReport public static SearchEntryPoint fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SearchEntryPoint.class); + return Common.fromJsonString(jsonString, SearchEntryPoint.class); } } diff --git a/src/main/java/com/google/genai/types/SearchTypes.java b/src/main/java/com/google/genai/types/SearchTypes.java index f86052de0e3..3f6d840e4a8 100644 --- a/src/main/java/com/google/genai/types/SearchTypes.java +++ b/src/main/java/com/google/genai/types/SearchTypes.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearImageSearch() { /** Deserializes a JSON string to a SearchTypes object. */ @ExcludeFromGeneratedCoverageReport public static SearchTypes fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SearchTypes.class); + return Common.fromJsonString(jsonString, SearchTypes.class); } } diff --git a/src/main/java/com/google/genai/types/Segment.java b/src/main/java/com/google/genai/types/Segment.java index 5b5d9edda2c..afe82d06041 100644 --- a/src/main/java/com/google/genai/types/Segment.java +++ b/src/main/java/com/google/genai/types/Segment.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -154,6 +155,6 @@ public Builder clearText() { /** Deserializes a JSON string to a Segment object. */ @ExcludeFromGeneratedCoverageReport public static Segment fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Segment.class); + return Common.fromJsonString(jsonString, Segment.class); } } diff --git a/src/main/java/com/google/genai/types/SegmentImageConfig.java b/src/main/java/com/google/genai/types/SegmentImageConfig.java index 6cf91b62d86..522896f9705 100644 --- a/src/main/java/com/google/genai/types/SegmentImageConfig.java +++ b/src/main/java/com/google/genai/types/SegmentImageConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -253,6 +254,6 @@ public Builder clearLabels() { /** Deserializes a JSON string to a SegmentImageConfig object. */ @ExcludeFromGeneratedCoverageReport public static SegmentImageConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SegmentImageConfig.class); + return Common.fromJsonString(jsonString, SegmentImageConfig.class); } } diff --git a/src/main/java/com/google/genai/types/SegmentImageParameters.java b/src/main/java/com/google/genai/types/SegmentImageParameters.java index d44cfd401f3..b8b3207c80e 100644 --- a/src/main/java/com/google/genai/types/SegmentImageParameters.java +++ b/src/main/java/com/google/genai/types/SegmentImageParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -146,6 +147,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a SegmentImageParameters object. */ @ExcludeFromGeneratedCoverageReport public static SegmentImageParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SegmentImageParameters.class); + return Common.fromJsonString(jsonString, SegmentImageParameters.class); } } diff --git a/src/main/java/com/google/genai/types/SegmentImageResponse.java b/src/main/java/com/google/genai/types/SegmentImageResponse.java index 5a6c5a1888f..61535956e2e 100644 --- a/src/main/java/com/google/genai/types/SegmentImageResponse.java +++ b/src/main/java/com/google/genai/types/SegmentImageResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -103,6 +104,6 @@ public Builder clearGeneratedMasks() { /** Deserializes a JSON string to a SegmentImageResponse object. */ @ExcludeFromGeneratedCoverageReport public static SegmentImageResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SegmentImageResponse.class); + return Common.fromJsonString(jsonString, SegmentImageResponse.class); } } diff --git a/src/main/java/com/google/genai/types/SegmentImageSource.java b/src/main/java/com/google/genai/types/SegmentImageSource.java index eb56669ab27..266ae9a2f13 100644 --- a/src/main/java/com/google/genai/types/SegmentImageSource.java +++ b/src/main/java/com/google/genai/types/SegmentImageSource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -149,6 +150,6 @@ public Builder clearScribbleImage() { /** Deserializes a JSON string to a SegmentImageSource object. */ @ExcludeFromGeneratedCoverageReport public static SegmentImageSource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SegmentImageSource.class); + return Common.fromJsonString(jsonString, SegmentImageSource.class); } } diff --git a/src/main/java/com/google/genai/types/SessionResumptionConfig.java b/src/main/java/com/google/genai/types/SessionResumptionConfig.java index 4006c1552b8..11d386c4352 100644 --- a/src/main/java/com/google/genai/types/SessionResumptionConfig.java +++ b/src/main/java/com/google/genai/types/SessionResumptionConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -113,6 +114,6 @@ public Builder clearTransparent() { /** Deserializes a JSON string to a SessionResumptionConfig object. */ @ExcludeFromGeneratedCoverageReport public static SessionResumptionConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SessionResumptionConfig.class); + return Common.fromJsonString(jsonString, SessionResumptionConfig.class); } } diff --git a/src/main/java/com/google/genai/types/SingleEmbedContentResponse.java b/src/main/java/com/google/genai/types/SingleEmbedContentResponse.java index a685035ef16..43c46d0a8d9 100644 --- a/src/main/java/com/google/genai/types/SingleEmbedContentResponse.java +++ b/src/main/java/com/google/genai/types/SingleEmbedContentResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -108,6 +109,6 @@ public Builder clearTokenCount() { /** Deserializes a JSON string to a SingleEmbedContentResponse object. */ @ExcludeFromGeneratedCoverageReport public static SingleEmbedContentResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SingleEmbedContentResponse.class); + return Common.fromJsonString(jsonString, SingleEmbedContentResponse.class); } } diff --git a/src/main/java/com/google/genai/types/SingleReinforcementTuningRewardConfig.java b/src/main/java/com/google/genai/types/SingleReinforcementTuningRewardConfig.java index a2c64bba329..fd077d4c579 100644 --- a/src/main/java/com/google/genai/types/SingleReinforcementTuningRewardConfig.java +++ b/src/main/java/com/google/genai/types/SingleReinforcementTuningRewardConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -284,6 +285,6 @@ public Builder clearCloudRunRewardScorer() { /** Deserializes a JSON string to a SingleReinforcementTuningRewardConfig object. */ @ExcludeFromGeneratedCoverageReport public static SingleReinforcementTuningRewardConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SingleReinforcementTuningRewardConfig.class); + return Common.fromJsonString(jsonString, SingleReinforcementTuningRewardConfig.class); } } diff --git a/src/main/java/com/google/genai/types/SlidingWindow.java b/src/main/java/com/google/genai/types/SlidingWindow.java index 6404af53364..6e2fb9aea13 100644 --- a/src/main/java/com/google/genai/types/SlidingWindow.java +++ b/src/main/java/com/google/genai/types/SlidingWindow.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -88,6 +89,6 @@ public Builder clearTargetTokens() { /** Deserializes a JSON string to a SlidingWindow object. */ @ExcludeFromGeneratedCoverageReport public static SlidingWindow fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SlidingWindow.class); + return Common.fromJsonString(jsonString, SlidingWindow.class); } } diff --git a/src/main/java/com/google/genai/types/SpeakerVoiceConfig.java b/src/main/java/com/google/genai/types/SpeakerVoiceConfig.java index b22970e470c..65ea594749c 100644 --- a/src/main/java/com/google/genai/types/SpeakerVoiceConfig.java +++ b/src/main/java/com/google/genai/types/SpeakerVoiceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearVoiceConfig() { /** Deserializes a JSON string to a SpeakerVoiceConfig object. */ @ExcludeFromGeneratedCoverageReport public static SpeakerVoiceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SpeakerVoiceConfig.class); + return Common.fromJsonString(jsonString, SpeakerVoiceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/SpeechConfig.java b/src/main/java/com/google/genai/types/SpeechConfig.java index c3fb8249be3..31dbd55930b 100644 --- a/src/main/java/com/google/genai/types/SpeechConfig.java +++ b/src/main/java/com/google/genai/types/SpeechConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -148,6 +149,6 @@ public Builder clearMultiSpeakerVoiceConfig() { /** Deserializes a JSON string to a SpeechConfig object. */ @ExcludeFromGeneratedCoverageReport public static SpeechConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SpeechConfig.class); + return Common.fromJsonString(jsonString, SpeechConfig.class); } } diff --git a/src/main/java/com/google/genai/types/StreamableHttpTransport.java b/src/main/java/com/google/genai/types/StreamableHttpTransport.java index 1337e16dffc..560d5ffa12e 100644 --- a/src/main/java/com/google/genai/types/StreamableHttpTransport.java +++ b/src/main/java/com/google/genai/types/StreamableHttpTransport.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Map; @@ -169,6 +170,6 @@ public Builder clearUrl() { /** Deserializes a JSON string to a StreamableHttpTransport object. */ @ExcludeFromGeneratedCoverageReport public static StreamableHttpTransport fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, StreamableHttpTransport.class); + return Common.fromJsonString(jsonString, StreamableHttpTransport.class); } } diff --git a/src/main/java/com/google/genai/types/StringList.java b/src/main/java/com/google/genai/types/StringList.java index ef5e00d9e6a..2041476d2a0 100644 --- a/src/main/java/com/google/genai/types/StringList.java +++ b/src/main/java/com/google/genai/types/StringList.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -91,6 +92,6 @@ public Builder clearValues() { /** Deserializes a JSON string to a StringList object. */ @ExcludeFromGeneratedCoverageReport public static StringList fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, StringList.class); + return Common.fromJsonString(jsonString, StringList.class); } } diff --git a/src/main/java/com/google/genai/types/StyleReferenceConfig.java b/src/main/java/com/google/genai/types/StyleReferenceConfig.java index 4c33940b31b..8466d78d8c6 100644 --- a/src/main/java/com/google/genai/types/StyleReferenceConfig.java +++ b/src/main/java/com/google/genai/types/StyleReferenceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearStyleDescription() { /** Deserializes a JSON string to a StyleReferenceConfig object. */ @ExcludeFromGeneratedCoverageReport public static StyleReferenceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, StyleReferenceConfig.class); + return Common.fromJsonString(jsonString, StyleReferenceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/StyleReferenceImage.java b/src/main/java/com/google/genai/types/StyleReferenceImage.java index dfe90f72575..2d4d5fadb16 100644 --- a/src/main/java/com/google/genai/types/StyleReferenceImage.java +++ b/src/main/java/com/google/genai/types/StyleReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -169,7 +170,7 @@ public Builder clearConfig() { /** Deserializes a JSON string to a StyleReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static StyleReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, StyleReferenceImage.class); + return Common.fromJsonString(jsonString, StyleReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/SubjectReferenceConfig.java b/src/main/java/com/google/genai/types/SubjectReferenceConfig.java index 7cc7635efa5..88c4716bbcc 100644 --- a/src/main/java/com/google/genai/types/SubjectReferenceConfig.java +++ b/src/main/java/com/google/genai/types/SubjectReferenceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -118,6 +119,6 @@ public Builder clearSubjectDescription() { /** Deserializes a JSON string to a SubjectReferenceConfig object. */ @ExcludeFromGeneratedCoverageReport public static SubjectReferenceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SubjectReferenceConfig.class); + return Common.fromJsonString(jsonString, SubjectReferenceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/SubjectReferenceImage.java b/src/main/java/com/google/genai/types/SubjectReferenceImage.java index d87a101a485..6ac6212f814 100644 --- a/src/main/java/com/google/genai/types/SubjectReferenceImage.java +++ b/src/main/java/com/google/genai/types/SubjectReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -169,7 +170,7 @@ public Builder clearConfig() { /** Deserializes a JSON string to a SubjectReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static SubjectReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SubjectReferenceImage.class); + return Common.fromJsonString(jsonString, SubjectReferenceImage.class); } @Override diff --git a/src/main/java/com/google/genai/types/SupervisedHyperParameters.java b/src/main/java/com/google/genai/types/SupervisedHyperParameters.java index 2ea92ce681f..c2485be5990 100644 --- a/src/main/java/com/google/genai/types/SupervisedHyperParameters.java +++ b/src/main/java/com/google/genai/types/SupervisedHyperParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -199,6 +200,6 @@ public Builder clearLearningRateMultiplier() { /** Deserializes a JSON string to a SupervisedHyperParameters object. */ @ExcludeFromGeneratedCoverageReport public static SupervisedHyperParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SupervisedHyperParameters.class); + return Common.fromJsonString(jsonString, SupervisedHyperParameters.class); } } diff --git a/src/main/java/com/google/genai/types/SupervisedTuningDataStats.java b/src/main/java/com/google/genai/types/SupervisedTuningDataStats.java index 32a3bdbba6b..87162049851 100644 --- a/src/main/java/com/google/genai/types/SupervisedTuningDataStats.java +++ b/src/main/java/com/google/genai/types/SupervisedTuningDataStats.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -422,6 +423,6 @@ public Builder clearUserOutputTokenDistribution() { /** Deserializes a JSON string to a SupervisedTuningDataStats object. */ @ExcludeFromGeneratedCoverageReport public static SupervisedTuningDataStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SupervisedTuningDataStats.class); + return Common.fromJsonString(jsonString, SupervisedTuningDataStats.class); } } diff --git a/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistribution.java b/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistribution.java index 0b57f805929..f7f4b9af559 100644 --- a/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistribution.java +++ b/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistribution.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -284,6 +285,6 @@ public Builder clearSum() { /** Deserializes a JSON string to a SupervisedTuningDatasetDistribution object. */ @ExcludeFromGeneratedCoverageReport public static SupervisedTuningDatasetDistribution fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SupervisedTuningDatasetDistribution.class); + return Common.fromJsonString(jsonString, SupervisedTuningDatasetDistribution.class); } } diff --git a/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistributionDatasetBucket.java b/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistributionDatasetBucket.java index 8c009ad41a4..f4ec904fdaf 100644 --- a/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistributionDatasetBucket.java +++ b/src/main/java/com/google/genai/types/SupervisedTuningDatasetDistributionDatasetBucket.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -126,7 +127,7 @@ public Builder clearRight() { /** Deserializes a JSON string to a SupervisedTuningDatasetDistributionDatasetBucket object. */ @ExcludeFromGeneratedCoverageReport public static SupervisedTuningDatasetDistributionDatasetBucket fromJson(String jsonString) { - return JsonSerializable.fromJsonString( + return Common.fromJsonString( jsonString, SupervisedTuningDatasetDistributionDatasetBucket.class); } } diff --git a/src/main/java/com/google/genai/types/SupervisedTuningSpec.java b/src/main/java/com/google/genai/types/SupervisedTuningSpec.java index 797537b4d3d..d1dae96da6a 100644 --- a/src/main/java/com/google/genai/types/SupervisedTuningSpec.java +++ b/src/main/java/com/google/genai/types/SupervisedTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -209,6 +210,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a SupervisedTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static SupervisedTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, SupervisedTuningSpec.class); + return Common.fromJsonString(jsonString, SupervisedTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/TestTableFile.java b/src/main/java/com/google/genai/types/TestTableFile.java index 799d264b125..b73744c803b 100644 --- a/src/main/java/com/google/genai/types/TestTableFile.java +++ b/src/main/java/com/google/genai/types/TestTableFile.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -179,6 +180,6 @@ public Builder clearTestTable() { /** Deserializes a JSON string to a TestTableFile object. */ @ExcludeFromGeneratedCoverageReport public static TestTableFile fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TestTableFile.class); + return Common.fromJsonString(jsonString, TestTableFile.class); } } diff --git a/src/main/java/com/google/genai/types/TestTableItem.java b/src/main/java/com/google/genai/types/TestTableItem.java index a4b7f4bcd61..a3bf06bc3cc 100644 --- a/src/main/java/com/google/genai/types/TestTableItem.java +++ b/src/main/java/com/google/genai/types/TestTableItem.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -258,6 +259,6 @@ public Builder clearIgnoreKeys() { /** Deserializes a JSON string to a TestTableItem object. */ @ExcludeFromGeneratedCoverageReport public static TestTableItem fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TestTableItem.class); + return Common.fromJsonString(jsonString, TestTableItem.class); } } diff --git a/src/main/java/com/google/genai/types/TextResponseFormat.java b/src/main/java/com/google/genai/types/TextResponseFormat.java index 976ac6fc121..bc7f4facd6b 100644 --- a/src/main/java/com/google/genai/types/TextResponseFormat.java +++ b/src/main/java/com/google/genai/types/TextResponseFormat.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -102,6 +103,6 @@ public Builder clearSchema() { /** Deserializes a JSON string to a TextResponseFormat object. */ @ExcludeFromGeneratedCoverageReport public static TextResponseFormat fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TextResponseFormat.class); + return Common.fromJsonString(jsonString, TextResponseFormat.class); } } diff --git a/src/main/java/com/google/genai/types/ThinkingConfig.java b/src/main/java/com/google/genai/types/ThinkingConfig.java index fbc3fccd8ca..1e7946aea9b 100644 --- a/src/main/java/com/google/genai/types/ThinkingConfig.java +++ b/src/main/java/com/google/genai/types/ThinkingConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -148,6 +149,6 @@ public Builder thinkingLevel(String thinkingLevel) { /** Deserializes a JSON string to a ThinkingConfig object. */ @ExcludeFromGeneratedCoverageReport public static ThinkingConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ThinkingConfig.class); + return Common.fromJsonString(jsonString, ThinkingConfig.class); } } diff --git a/src/main/java/com/google/genai/types/TokensInfo.java b/src/main/java/com/google/genai/types/TokensInfo.java index bfdb8496b4f..969e0896e0a 100644 --- a/src/main/java/com/google/genai/types/TokensInfo.java +++ b/src/main/java/com/google/genai/types/TokensInfo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -142,6 +143,6 @@ public Builder clearTokens() { /** Deserializes a JSON string to a TokensInfo object. */ @ExcludeFromGeneratedCoverageReport public static TokensInfo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TokensInfo.class); + return Common.fromJsonString(jsonString, TokensInfo.class); } } diff --git a/src/main/java/com/google/genai/types/Tool.java b/src/main/java/com/google/genai/types/Tool.java index 68121d26195..d325d192ca9 100644 --- a/src/main/java/com/google/genai/types/Tool.java +++ b/src/main/java/com/google/genai/types/Tool.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.lang.reflect.Method; import java.util.Arrays; @@ -614,6 +615,6 @@ public Builder clearExaAiSearch() { /** Deserializes a JSON string to a Tool object. */ @ExcludeFromGeneratedCoverageReport public static Tool fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Tool.class); + return Common.fromJsonString(jsonString, Tool.class); } } diff --git a/src/main/java/com/google/genai/types/ToolCall.java b/src/main/java/com/google/genai/types/ToolCall.java index 749810f6b16..ebfb4cd2c5a 100644 --- a/src/main/java/com/google/genai/types/ToolCall.java +++ b/src/main/java/com/google/genai/types/ToolCall.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -152,6 +153,6 @@ public Builder clearArgs() { /** Deserializes a JSON string to a ToolCall object. */ @ExcludeFromGeneratedCoverageReport public static ToolCall fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolCall.class); + return Common.fromJsonString(jsonString, ToolCall.class); } } diff --git a/src/main/java/com/google/genai/types/ToolCodeExecution.java b/src/main/java/com/google/genai/types/ToolCodeExecution.java index 16d5e69996f..52d778ad2ee 100644 --- a/src/main/java/com/google/genai/types/ToolCodeExecution.java +++ b/src/main/java/com/google/genai/types/ToolCodeExecution.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** @@ -55,6 +56,6 @@ private static Builder create() { /** Deserializes a JSON string to a ToolCodeExecution object. */ @ExcludeFromGeneratedCoverageReport public static ToolCodeExecution fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolCodeExecution.class); + return Common.fromJsonString(jsonString, ToolCodeExecution.class); } } diff --git a/src/main/java/com/google/genai/types/ToolConfig.java b/src/main/java/com/google/genai/types/ToolConfig.java index 59e2766cf75..c3967c06c4d 100644 --- a/src/main/java/com/google/genai/types/ToolConfig.java +++ b/src/main/java/com/google/genai/types/ToolConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -149,6 +150,6 @@ public Builder clearIncludeServerSideToolInvocations() { /** Deserializes a JSON string to a ToolConfig object. */ @ExcludeFromGeneratedCoverageReport public static ToolConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolConfig.class); + return Common.fromJsonString(jsonString, ToolConfig.class); } } diff --git a/src/main/java/com/google/genai/types/ToolExaAiSearch.java b/src/main/java/com/google/genai/types/ToolExaAiSearch.java index b562c39a467..5a92f694922 100644 --- a/src/main/java/com/google/genai/types/ToolExaAiSearch.java +++ b/src/main/java/com/google/genai/types/ToolExaAiSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -103,6 +104,6 @@ public Builder clearCustomConfigs() { /** Deserializes a JSON string to a ToolExaAiSearch object. */ @ExcludeFromGeneratedCoverageReport public static ToolExaAiSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolExaAiSearch.class); + return Common.fromJsonString(jsonString, ToolExaAiSearch.class); } } diff --git a/src/main/java/com/google/genai/types/ToolParallelAiSearch.java b/src/main/java/com/google/genai/types/ToolParallelAiSearch.java index 70c2d5c9fbe..df7e8f38dc8 100644 --- a/src/main/java/com/google/genai/types/ToolParallelAiSearch.java +++ b/src/main/java/com/google/genai/types/ToolParallelAiSearch.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -123,6 +124,6 @@ public Builder clearCustomConfigs() { /** Deserializes a JSON string to a ToolParallelAiSearch object. */ @ExcludeFromGeneratedCoverageReport public static ToolParallelAiSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolParallelAiSearch.class); + return Common.fromJsonString(jsonString, ToolParallelAiSearch.class); } } diff --git a/src/main/java/com/google/genai/types/ToolResponse.java b/src/main/java/com/google/genai/types/ToolResponse.java index ad78bb0affa..f50e4c90b44 100644 --- a/src/main/java/com/google/genai/types/ToolResponse.java +++ b/src/main/java/com/google/genai/types/ToolResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -150,6 +151,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a ToolResponse object. */ @ExcludeFromGeneratedCoverageReport public static ToolResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, ToolResponse.class); + return Common.fromJsonString(jsonString, ToolResponse.class); } } diff --git a/src/main/java/com/google/genai/types/Transcription.java b/src/main/java/com/google/genai/types/Transcription.java index 48be456279f..b43eb760482 100644 --- a/src/main/java/com/google/genai/types/Transcription.java +++ b/src/main/java/com/google/genai/types/Transcription.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -192,6 +193,6 @@ public Builder clearWords() { /** Deserializes a JSON string to a Transcription object. */ @ExcludeFromGeneratedCoverageReport public static Transcription fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Transcription.class); + return Common.fromJsonString(jsonString, Transcription.class); } } diff --git a/src/main/java/com/google/genai/types/TranslationConfig.java b/src/main/java/com/google/genai/types/TranslationConfig.java index 173d2b5594d..37f4375a96f 100644 --- a/src/main/java/com/google/genai/types/TranslationConfig.java +++ b/src/main/java/com/google/genai/types/TranslationConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -108,6 +109,6 @@ public Builder clearTargetLanguageCode() { /** Deserializes a JSON string to a TranslationConfig object. */ @ExcludeFromGeneratedCoverageReport public static TranslationConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TranslationConfig.class); + return Common.fromJsonString(jsonString, TranslationConfig.class); } } diff --git a/src/main/java/com/google/genai/types/TunedModel.java b/src/main/java/com/google/genai/types/TunedModel.java index 26b10aa7052..a76da48c852 100644 --- a/src/main/java/com/google/genai/types/TunedModel.java +++ b/src/main/java/com/google/genai/types/TunedModel.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -167,6 +168,6 @@ public Builder clearCheckpoints() { /** Deserializes a JSON string to a TunedModel object. */ @ExcludeFromGeneratedCoverageReport public static TunedModel fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TunedModel.class); + return Common.fromJsonString(jsonString, TunedModel.class); } } diff --git a/src/main/java/com/google/genai/types/TunedModelCheckpoint.java b/src/main/java/com/google/genai/types/TunedModelCheckpoint.java index 54fb4d3a6ff..0aa83c2d489 100644 --- a/src/main/java/com/google/genai/types/TunedModelCheckpoint.java +++ b/src/main/java/com/google/genai/types/TunedModelCheckpoint.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -146,6 +147,6 @@ public Builder clearEndpoint() { /** Deserializes a JSON string to a TunedModelCheckpoint object. */ @ExcludeFromGeneratedCoverageReport public static TunedModelCheckpoint fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TunedModelCheckpoint.class); + return Common.fromJsonString(jsonString, TunedModelCheckpoint.class); } } diff --git a/src/main/java/com/google/genai/types/TunedModelInfo.java b/src/main/java/com/google/genai/types/TunedModelInfo.java index d03145d4bad..3e09c079339 100644 --- a/src/main/java/com/google/genai/types/TunedModelInfo.java +++ b/src/main/java/com/google/genai/types/TunedModelInfo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Optional; @@ -121,6 +122,6 @@ public Builder clearUpdateTime() { /** Deserializes a JSON string to a TunedModelInfo object. */ @ExcludeFromGeneratedCoverageReport public static TunedModelInfo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TunedModelInfo.class); + return Common.fromJsonString(jsonString, TunedModelInfo.class); } } diff --git a/src/main/java/com/google/genai/types/TuningDataStats.java b/src/main/java/com/google/genai/types/TuningDataStats.java index c1c3edd0385..db6aeaae4a2 100644 --- a/src/main/java/com/google/genai/types/TuningDataStats.java +++ b/src/main/java/com/google/genai/types/TuningDataStats.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -198,6 +199,6 @@ public Builder clearReinforcementTuningDataStats() { /** Deserializes a JSON string to a TuningDataStats object. */ @ExcludeFromGeneratedCoverageReport public static TuningDataStats fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningDataStats.class); + return Common.fromJsonString(jsonString, TuningDataStats.class); } } diff --git a/src/main/java/com/google/genai/types/TuningDataset.java b/src/main/java/com/google/genai/types/TuningDataset.java index 18967b80854..2785e53275f 100644 --- a/src/main/java/com/google/genai/types/TuningDataset.java +++ b/src/main/java/com/google/genai/types/TuningDataset.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -153,6 +154,6 @@ public Builder clearExamples() { /** Deserializes a JSON string to a TuningDataset object. */ @ExcludeFromGeneratedCoverageReport public static TuningDataset fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningDataset.class); + return Common.fromJsonString(jsonString, TuningDataset.class); } } diff --git a/src/main/java/com/google/genai/types/TuningExample.java b/src/main/java/com/google/genai/types/TuningExample.java index 43af520672c..590aa657bf9 100644 --- a/src/main/java/com/google/genai/types/TuningExample.java +++ b/src/main/java/com/google/genai/types/TuningExample.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder clearTextInput() { /** Deserializes a JSON string to a TuningExample object. */ @ExcludeFromGeneratedCoverageReport public static TuningExample fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningExample.class); + return Common.fromJsonString(jsonString, TuningExample.class); } } diff --git a/src/main/java/com/google/genai/types/TuningJob.java b/src/main/java/com/google/genai/types/TuningJob.java index 709982b84e2..1636a41eb97 100644 --- a/src/main/java/com/google/genai/types/TuningJob.java +++ b/src/main/java/com/google/genai/types/TuningJob.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Instant; import java.util.Arrays; @@ -1128,6 +1129,6 @@ public Builder clearDistillationSamplingSpec() { /** Deserializes a JSON string to a TuningJob object. */ @ExcludeFromGeneratedCoverageReport public static TuningJob fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningJob.class); + return Common.fromJsonString(jsonString, TuningJob.class); } } diff --git a/src/main/java/com/google/genai/types/TuningJobMetadata.java b/src/main/java/com/google/genai/types/TuningJobMetadata.java index bca4845e4ef..4393115e958 100644 --- a/src/main/java/com/google/genai/types/TuningJobMetadata.java +++ b/src/main/java/com/google/genai/types/TuningJobMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -99,6 +100,6 @@ public Builder clearCompletedStepCount() { /** Deserializes a JSON string to a TuningJobMetadata object. */ @ExcludeFromGeneratedCoverageReport public static TuningJobMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningJobMetadata.class); + return Common.fromJsonString(jsonString, TuningJobMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/TuningOperation.java b/src/main/java/com/google/genai/types/TuningOperation.java index c943eb34309..5819fbabfde 100644 --- a/src/main/java/com/google/genai/types/TuningOperation.java +++ b/src/main/java/com/google/genai/types/TuningOperation.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -193,6 +194,6 @@ public Builder clearError() { /** Deserializes a JSON string to a TuningOperation object. */ @ExcludeFromGeneratedCoverageReport public static TuningOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningOperation.class); + return Common.fromJsonString(jsonString, TuningOperation.class); } } diff --git a/src/main/java/com/google/genai/types/TuningValidationDataset.java b/src/main/java/com/google/genai/types/TuningValidationDataset.java index cc63cc84c41..83629935608 100644 --- a/src/main/java/com/google/genai/types/TuningValidationDataset.java +++ b/src/main/java/com/google/genai/types/TuningValidationDataset.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -104,6 +105,6 @@ public Builder clearVertexDatasetResource() { /** Deserializes a JSON string to a TuningValidationDataset object. */ @ExcludeFromGeneratedCoverageReport public static TuningValidationDataset fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, TuningValidationDataset.class); + return Common.fromJsonString(jsonString, TuningValidationDataset.class); } } diff --git a/src/main/java/com/google/genai/types/UnifiedMetric.java b/src/main/java/com/google/genai/types/UnifiedMetric.java index 8a3de976997..d1be8689ba9 100644 --- a/src/main/java/com/google/genai/types/UnifiedMetric.java +++ b/src/main/java/com/google/genai/types/UnifiedMetric.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -284,6 +285,6 @@ public Builder clearComputationBasedMetricSpec() { /** Deserializes a JSON string to a UnifiedMetric object. */ @ExcludeFromGeneratedCoverageReport public static UnifiedMetric fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UnifiedMetric.class); + return Common.fromJsonString(jsonString, UnifiedMetric.class); } } diff --git a/src/main/java/com/google/genai/types/UpdateCachedContentConfig.java b/src/main/java/com/google/genai/types/UpdateCachedContentConfig.java index 986f820bde8..3bc44650c02 100644 --- a/src/main/java/com/google/genai/types/UpdateCachedContentConfig.java +++ b/src/main/java/com/google/genai/types/UpdateCachedContentConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.time.Instant; @@ -140,6 +141,6 @@ public Builder clearExpireTime() { /** Deserializes a JSON string to a UpdateCachedContentConfig object. */ @ExcludeFromGeneratedCoverageReport public static UpdateCachedContentConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpdateCachedContentConfig.class); + return Common.fromJsonString(jsonString, UpdateCachedContentConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UpdateCachedContentParameters.java b/src/main/java/com/google/genai/types/UpdateCachedContentParameters.java index ceea586b23d..8ca1124555b 100644 --- a/src/main/java/com/google/genai/types/UpdateCachedContentParameters.java +++ b/src/main/java/com/google/genai/types/UpdateCachedContentParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -112,6 +113,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a UpdateCachedContentParameters object. */ @ExcludeFromGeneratedCoverageReport public static UpdateCachedContentParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpdateCachedContentParameters.class); + return Common.fromJsonString(jsonString, UpdateCachedContentParameters.class); } } diff --git a/src/main/java/com/google/genai/types/UpdateModelConfig.java b/src/main/java/com/google/genai/types/UpdateModelConfig.java index 48838607f31..c03a50954c6 100644 --- a/src/main/java/com/google/genai/types/UpdateModelConfig.java +++ b/src/main/java/com/google/genai/types/UpdateModelConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -152,6 +153,6 @@ public Builder clearDefaultCheckpointId() { /** Deserializes a JSON string to a UpdateModelConfig object. */ @ExcludeFromGeneratedCoverageReport public static UpdateModelConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpdateModelConfig.class); + return Common.fromJsonString(jsonString, UpdateModelConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UpdateModelParameters.java b/src/main/java/com/google/genai/types/UpdateModelParameters.java index be73504fb7f..57cf3924135 100644 --- a/src/main/java/com/google/genai/types/UpdateModelParameters.java +++ b/src/main/java/com/google/genai/types/UpdateModelParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -110,6 +111,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a UpdateModelParameters object. */ @ExcludeFromGeneratedCoverageReport public static UpdateModelParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpdateModelParameters.class); + return Common.fromJsonString(jsonString, UpdateModelParameters.class); } } diff --git a/src/main/java/com/google/genai/types/UploadFileConfig.java b/src/main/java/com/google/genai/types/UploadFileConfig.java index 0521241c950..20d2f20950d 100644 --- a/src/main/java/com/google/genai/types/UploadFileConfig.java +++ b/src/main/java/com/google/genai/types/UploadFileConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -160,6 +161,6 @@ public Builder clearDisplayName() { /** Deserializes a JSON string to a UploadFileConfig object. */ @ExcludeFromGeneratedCoverageReport public static UploadFileConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UploadFileConfig.class); + return Common.fromJsonString(jsonString, UploadFileConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UploadToFileSearchStoreConfig.java b/src/main/java/com/google/genai/types/UploadToFileSearchStoreConfig.java index 3ce5e033315..02a462b3207 100644 --- a/src/main/java/com/google/genai/types/UploadToFileSearchStoreConfig.java +++ b/src/main/java/com/google/genai/types/UploadToFileSearchStoreConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -240,6 +241,6 @@ public Builder clearChunkingConfig() { /** Deserializes a JSON string to a UploadToFileSearchStoreConfig object. */ @ExcludeFromGeneratedCoverageReport public static UploadToFileSearchStoreConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UploadToFileSearchStoreConfig.class); + return Common.fromJsonString(jsonString, UploadToFileSearchStoreConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UploadToFileSearchStoreOperation.java b/src/main/java/com/google/genai/types/UploadToFileSearchStoreOperation.java index 0e9aaec5ce7..0a422b563af 100644 --- a/src/main/java/com/google/genai/types/UploadToFileSearchStoreOperation.java +++ b/src/main/java/com/google/genai/types/UploadToFileSearchStoreOperation.java @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.genai.JsonSerializable; +import com.google.genai.Common; import com.google.genai.OperationsConverters; import java.util.Map; import java.util.Optional; @@ -45,7 +45,7 @@ public UploadToFileSearchStoreOperation fromApiResponse( OperationsConverters converter = new OperationsConverters(null); JsonNode response; response = converter.uploadToFileSearchStoreOperationFromMldev(apiResponse, null); - return JsonSerializable.fromJsonNode(response, UploadToFileSearchStoreOperation.class); + return Common.fromJsonNode(response, UploadToFileSearchStoreOperation.class); } /** Instantiates a builder for UploadToFileSearchStoreOperation. */ @@ -183,6 +183,6 @@ public Builder clearResponse() { /** Deserializes a JSON string to a UploadToFileSearchStoreOperation object. */ @ExcludeFromGeneratedCoverageReport public static UploadToFileSearchStoreOperation fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UploadToFileSearchStoreOperation.class); + return Common.fromJsonString(jsonString, UploadToFileSearchStoreOperation.class); } } diff --git a/src/main/java/com/google/genai/types/UploadToFileSearchStoreParameters.java b/src/main/java/com/google/genai/types/UploadToFileSearchStoreParameters.java index be5cdd33e8f..e630d6c9e55 100644 --- a/src/main/java/com/google/genai/types/UploadToFileSearchStoreParameters.java +++ b/src/main/java/com/google/genai/types/UploadToFileSearchStoreParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -116,6 +117,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a UploadToFileSearchStoreParameters object. */ @ExcludeFromGeneratedCoverageReport public static UploadToFileSearchStoreParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UploadToFileSearchStoreParameters.class); + return Common.fromJsonString(jsonString, UploadToFileSearchStoreParameters.class); } } diff --git a/src/main/java/com/google/genai/types/UploadToFileSearchStoreResponse.java b/src/main/java/com/google/genai/types/UploadToFileSearchStoreResponse.java index 9bc2e2a4bd0..f30769dd6f9 100644 --- a/src/main/java/com/google/genai/types/UploadToFileSearchStoreResponse.java +++ b/src/main/java/com/google/genai/types/UploadToFileSearchStoreResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -132,6 +133,6 @@ public Builder clearDocumentName() { /** Deserializes a JSON string to a UploadToFileSearchStoreResponse object. */ @ExcludeFromGeneratedCoverageReport public static UploadToFileSearchStoreResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UploadToFileSearchStoreResponse.class); + return Common.fromJsonString(jsonString, UploadToFileSearchStoreResponse.class); } } diff --git a/src/main/java/com/google/genai/types/UploadToFileSearchStoreResumableResponse.java b/src/main/java/com/google/genai/types/UploadToFileSearchStoreResumableResponse.java index cbd3b3b6751..9f30689a9df 100644 --- a/src/main/java/com/google/genai/types/UploadToFileSearchStoreResumableResponse.java +++ b/src/main/java/com/google/genai/types/UploadToFileSearchStoreResumableResponse.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -89,7 +90,6 @@ public Builder clearSdkHttpResponse() { /** Deserializes a JSON string to a UploadToFileSearchStoreResumableResponse object. */ @ExcludeFromGeneratedCoverageReport public static UploadToFileSearchStoreResumableResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString( - jsonString, UploadToFileSearchStoreResumableResponse.class); + return Common.fromJsonString(jsonString, UploadToFileSearchStoreResumableResponse.class); } } diff --git a/src/main/java/com/google/genai/types/UpscaleImageAPIConfig.java b/src/main/java/com/google/genai/types/UpscaleImageAPIConfig.java index 9ff395b27c8..f51adfd82e1 100644 --- a/src/main/java/com/google/genai/types/UpscaleImageAPIConfig.java +++ b/src/main/java/com/google/genai/types/UpscaleImageAPIConfig.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -387,6 +388,6 @@ public Builder clearMode() { /** Deserializes a JSON string to a UpscaleImageAPIConfig object. */ @ExcludeFromGeneratedCoverageReport public static UpscaleImageAPIConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpscaleImageAPIConfig.class); + return Common.fromJsonString(jsonString, UpscaleImageAPIConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UpscaleImageAPIParameters.java b/src/main/java/com/google/genai/types/UpscaleImageAPIParameters.java index 3d9b7ff6c1e..44866ee3d1b 100644 --- a/src/main/java/com/google/genai/types/UpscaleImageAPIParameters.java +++ b/src/main/java/com/google/genai/types/UpscaleImageAPIParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -154,6 +155,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a UpscaleImageAPIParameters object. */ @ExcludeFromGeneratedCoverageReport public static UpscaleImageAPIParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpscaleImageAPIParameters.class); + return Common.fromJsonString(jsonString, UpscaleImageAPIParameters.class); } } diff --git a/src/main/java/com/google/genai/types/UpscaleImageConfig.java b/src/main/java/com/google/genai/types/UpscaleImageConfig.java index 3f0867668c4..1992d2a613d 100644 --- a/src/main/java/com/google/genai/types/UpscaleImageConfig.java +++ b/src/main/java/com/google/genai/types/UpscaleImageConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Map; import java.util.Optional; @@ -341,6 +342,6 @@ public Builder clearLabels() { /** Deserializes a JSON string to a UpscaleImageConfig object. */ @ExcludeFromGeneratedCoverageReport public static UpscaleImageConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpscaleImageConfig.class); + return Common.fromJsonString(jsonString, UpscaleImageConfig.class); } } diff --git a/src/main/java/com/google/genai/types/UpscaleImageParameters.java b/src/main/java/com/google/genai/types/UpscaleImageParameters.java index f94711484c6..f8f372922ce 100644 --- a/src/main/java/com/google/genai/types/UpscaleImageParameters.java +++ b/src/main/java/com/google/genai/types/UpscaleImageParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -164,6 +165,6 @@ public Builder clearConfig() { /** Deserializes a JSON string to a UpscaleImageParameters object. */ @ExcludeFromGeneratedCoverageReport public static UpscaleImageParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpscaleImageParameters.class); + return Common.fromJsonString(jsonString, UpscaleImageParameters.class); } } diff --git a/src/main/java/com/google/genai/types/UpscaleImageResponse.java b/src/main/java/com/google/genai/types/UpscaleImageResponse.java index 91df2b3cdef..ddcdcb2e2d9 100644 --- a/src/main/java/com/google/genai/types/UpscaleImageResponse.java +++ b/src/main/java/com/google/genai/types/UpscaleImageResponse.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -135,6 +136,6 @@ public Builder clearGeneratedImages() { /** Deserializes a JSON string to a UpscaleImageResponse object. */ @ExcludeFromGeneratedCoverageReport public static UpscaleImageResponse fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UpscaleImageResponse.class); + return Common.fromJsonString(jsonString, UpscaleImageResponse.class); } } diff --git a/src/main/java/com/google/genai/types/UrlContext.java b/src/main/java/com/google/genai/types/UrlContext.java index b7ffd122b32..4a1e73458fc 100644 --- a/src/main/java/com/google/genai/types/UrlContext.java +++ b/src/main/java/com/google/genai/types/UrlContext.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** Tool to support URL context. */ @@ -51,6 +52,6 @@ private static Builder create() { /** Deserializes a JSON string to a UrlContext object. */ @ExcludeFromGeneratedCoverageReport public static UrlContext fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UrlContext.class); + return Common.fromJsonString(jsonString, UrlContext.class); } } diff --git a/src/main/java/com/google/genai/types/UrlContextMetadata.java b/src/main/java/com/google/genai/types/UrlContextMetadata.java index 3f5a940d0ef..efd13e43be5 100644 --- a/src/main/java/com/google/genai/types/UrlContextMetadata.java +++ b/src/main/java/com/google/genai/types/UrlContextMetadata.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -109,6 +110,6 @@ public Builder clearUrlMetadata() { /** Deserializes a JSON string to a UrlContextMetadata object. */ @ExcludeFromGeneratedCoverageReport public static UrlContextMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UrlContextMetadata.class); + return Common.fromJsonString(jsonString, UrlContextMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/UrlMetadata.java b/src/main/java/com/google/genai/types/UrlMetadata.java index ee40d77fb12..8c00eb81306 100644 --- a/src/main/java/com/google/genai/types/UrlMetadata.java +++ b/src/main/java/com/google/genai/types/UrlMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -118,6 +119,6 @@ public Builder urlRetrievalStatus(String urlRetrievalStatus) { /** Deserializes a JSON string to a UrlMetadata object. */ @ExcludeFromGeneratedCoverageReport public static UrlMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UrlMetadata.class); + return Common.fromJsonString(jsonString, UrlMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/UsageMetadata.java b/src/main/java/com/google/genai/types/UsageMetadata.java index 9ca3736c80e..f74dd038479 100644 --- a/src/main/java/com/google/genai/types/UsageMetadata.java +++ b/src/main/java/com/google/genai/types/UsageMetadata.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -499,6 +500,6 @@ public Builder serviceTier(String serviceTier) { /** Deserializes a JSON string to a UsageMetadata object. */ @ExcludeFromGeneratedCoverageReport public static UsageMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, UsageMetadata.class); + return Common.fromJsonString(jsonString, UsageMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/VeoHyperParameters.java b/src/main/java/com/google/genai/types/VeoHyperParameters.java index 1ed27411094..6f20f854575 100644 --- a/src/main/java/com/google/genai/types/VeoHyperParameters.java +++ b/src/main/java/com/google/genai/types/VeoHyperParameters.java @@ -24,6 +24,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -258,6 +259,6 @@ public Builder tuningSpeed(String tuningSpeed) { /** Deserializes a JSON string to a VeoHyperParameters object. */ @ExcludeFromGeneratedCoverageReport public static VeoHyperParameters fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VeoHyperParameters.class); + return Common.fromJsonString(jsonString, VeoHyperParameters.class); } } diff --git a/src/main/java/com/google/genai/types/VeoLoraTuningSpec.java b/src/main/java/com/google/genai/types/VeoLoraTuningSpec.java index 727d8affe5d..85107f440b2 100644 --- a/src/main/java/com/google/genai/types/VeoLoraTuningSpec.java +++ b/src/main/java/com/google/genai/types/VeoLoraTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -182,6 +183,6 @@ public Builder videoOrientation(String videoOrientation) { /** Deserializes a JSON string to a VeoLoraTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static VeoLoraTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VeoLoraTuningSpec.class); + return Common.fromJsonString(jsonString, VeoLoraTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/VeoTuningSpec.java b/src/main/java/com/google/genai/types/VeoTuningSpec.java index 6043d614998..85b7e82439d 100644 --- a/src/main/java/com/google/genai/types/VeoTuningSpec.java +++ b/src/main/java/com/google/genai/types/VeoTuningSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -140,6 +141,6 @@ public Builder clearValidationDatasetUri() { /** Deserializes a JSON string to a VeoTuningSpec object. */ @ExcludeFromGeneratedCoverageReport public static VeoTuningSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VeoTuningSpec.class); + return Common.fromJsonString(jsonString, VeoTuningSpec.class); } } diff --git a/src/main/java/com/google/genai/types/VertexAISearch.java b/src/main/java/com/google/genai/types/VertexAISearch.java index 90f1f9cdafc..9f43e21395c 100644 --- a/src/main/java/com/google/genai/types/VertexAISearch.java +++ b/src/main/java/com/google/genai/types/VertexAISearch.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -217,6 +218,6 @@ public Builder clearMaxResults() { /** Deserializes a JSON string to a VertexAISearch object. */ @ExcludeFromGeneratedCoverageReport public static VertexAISearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VertexAISearch.class); + return Common.fromJsonString(jsonString, VertexAISearch.class); } } diff --git a/src/main/java/com/google/genai/types/VertexAISearchDataStoreSpec.java b/src/main/java/com/google/genai/types/VertexAISearchDataStoreSpec.java index 602efa586a8..7a061b70d84 100644 --- a/src/main/java/com/google/genai/types/VertexAISearchDataStoreSpec.java +++ b/src/main/java/com/google/genai/types/VertexAISearchDataStoreSpec.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -113,6 +114,6 @@ public Builder clearFilter() { /** Deserializes a JSON string to a VertexAISearchDataStoreSpec object. */ @ExcludeFromGeneratedCoverageReport public static VertexAISearchDataStoreSpec fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VertexAISearchDataStoreSpec.class); + return Common.fromJsonString(jsonString, VertexAISearchDataStoreSpec.class); } } diff --git a/src/main/java/com/google/genai/types/VertexMultimodalDatasetDestination.java b/src/main/java/com/google/genai/types/VertexMultimodalDatasetDestination.java index 800426705bd..207e7a1028d 100644 --- a/src/main/java/com/google/genai/types/VertexMultimodalDatasetDestination.java +++ b/src/main/java/com/google/genai/types/VertexMultimodalDatasetDestination.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -105,6 +106,6 @@ public Builder clearDisplayName() { /** Deserializes a JSON string to a VertexMultimodalDatasetDestination object. */ @ExcludeFromGeneratedCoverageReport public static VertexMultimodalDatasetDestination fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VertexMultimodalDatasetDestination.class); + return Common.fromJsonString(jsonString, VertexMultimodalDatasetDestination.class); } } diff --git a/src/main/java/com/google/genai/types/VertexRagStore.java b/src/main/java/com/google/genai/types/VertexRagStore.java index 99f7d0df812..5ff78fb58ad 100644 --- a/src/main/java/com/google/genai/types/VertexRagStore.java +++ b/src/main/java/com/google/genai/types/VertexRagStore.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -252,6 +253,6 @@ public Builder clearVectorDistanceThreshold() { /** Deserializes a JSON string to a VertexRagStore object. */ @ExcludeFromGeneratedCoverageReport public static VertexRagStore fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VertexRagStore.class); + return Common.fromJsonString(jsonString, VertexRagStore.class); } } diff --git a/src/main/java/com/google/genai/types/VertexRagStoreRagResource.java b/src/main/java/com/google/genai/types/VertexRagStoreRagResource.java index 43b6bc8b312..cb2302a8fd8 100644 --- a/src/main/java/com/google/genai/types/VertexRagStoreRagResource.java +++ b/src/main/java/com/google/genai/types/VertexRagStoreRagResource.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -116,6 +117,6 @@ public Builder clearRagFileIds() { /** Deserializes a JSON string to a VertexRagStoreRagResource object. */ @ExcludeFromGeneratedCoverageReport public static VertexRagStoreRagResource fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VertexRagStoreRagResource.class); + return Common.fromJsonString(jsonString, VertexRagStoreRagResource.class); } } diff --git a/src/main/java/com/google/genai/types/Video.java b/src/main/java/com/google/genai/types/Video.java index 11bcb4d1602..c60aad86cb0 100644 --- a/src/main/java/com/google/genai/types/Video.java +++ b/src/main/java/com/google/genai/types/Video.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearMimeType() { /** Deserializes a JSON string to a Video object. */ @ExcludeFromGeneratedCoverageReport public static Video fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, Video.class); + return Common.fromJsonString(jsonString, Video.class); } } diff --git a/src/main/java/com/google/genai/types/VideoGenerationMask.java b/src/main/java/com/google/genai/types/VideoGenerationMask.java index a081efb4937..c60f3bc864a 100644 --- a/src/main/java/com/google/genai/types/VideoGenerationMask.java +++ b/src/main/java/com/google/genai/types/VideoGenerationMask.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -134,6 +135,6 @@ public Builder maskMode(String maskMode) { /** Deserializes a JSON string to a VideoGenerationMask object. */ @ExcludeFromGeneratedCoverageReport public static VideoGenerationMask fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VideoGenerationMask.class); + return Common.fromJsonString(jsonString, VideoGenerationMask.class); } } diff --git a/src/main/java/com/google/genai/types/VideoGenerationReferenceImage.java b/src/main/java/com/google/genai/types/VideoGenerationReferenceImage.java index cc45ae3e568..6f6711640eb 100644 --- a/src/main/java/com/google/genai/types/VideoGenerationReferenceImage.java +++ b/src/main/java/com/google/genai/types/VideoGenerationReferenceImage.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -136,6 +137,6 @@ public Builder referenceType(String referenceType) { /** Deserializes a JSON string to a VideoGenerationReferenceImage object. */ @ExcludeFromGeneratedCoverageReport public static VideoGenerationReferenceImage fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VideoGenerationReferenceImage.class); + return Common.fromJsonString(jsonString, VideoGenerationReferenceImage.class); } } diff --git a/src/main/java/com/google/genai/types/VideoMetadata.java b/src/main/java/com/google/genai/types/VideoMetadata.java index c7a466f2ae3..6578ccc994d 100644 --- a/src/main/java/com/google/genai/types/VideoMetadata.java +++ b/src/main/java/com/google/genai/types/VideoMetadata.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Optional; @@ -128,6 +129,6 @@ public Builder clearStartOffset() { /** Deserializes a JSON string to a VideoMetadata object. */ @ExcludeFromGeneratedCoverageReport public static VideoMetadata fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VideoMetadata.class); + return Common.fromJsonString(jsonString, VideoMetadata.class); } } diff --git a/src/main/java/com/google/genai/types/VideoResponseFormat.java b/src/main/java/com/google/genai/types/VideoResponseFormat.java index fd13bc57a68..c6554a19377 100644 --- a/src/main/java/com/google/genai/types/VideoResponseFormat.java +++ b/src/main/java/com/google/genai/types/VideoResponseFormat.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Optional; @@ -190,6 +191,6 @@ public Builder clearGcsUri() { /** Deserializes a JSON string to a VideoResponseFormat object. */ @ExcludeFromGeneratedCoverageReport public static VideoResponseFormat fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VideoResponseFormat.class); + return Common.fromJsonString(jsonString, VideoResponseFormat.class); } } diff --git a/src/main/java/com/google/genai/types/VoiceActivity.java b/src/main/java/com/google/genai/types/VoiceActivity.java index 5f8a80c9d3d..a7c776da314 100644 --- a/src/main/java/com/google/genai/types/VoiceActivity.java +++ b/src/main/java/com/google/genai/types/VoiceActivity.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.time.Duration; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearAudioOffset() { /** Deserializes a JSON string to a VoiceActivity object. */ @ExcludeFromGeneratedCoverageReport public static VoiceActivity fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VoiceActivity.class); + return Common.fromJsonString(jsonString, VoiceActivity.class); } } diff --git a/src/main/java/com/google/genai/types/VoiceActivityDetectionSignal.java b/src/main/java/com/google/genai/types/VoiceActivityDetectionSignal.java index b32b32b96b9..ae895641c1a 100644 --- a/src/main/java/com/google/genai/types/VoiceActivityDetectionSignal.java +++ b/src/main/java/com/google/genai/types/VoiceActivityDetectionSignal.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder vadSignalType(String vadSignalType) { /** Deserializes a JSON string to a VoiceActivityDetectionSignal object. */ @ExcludeFromGeneratedCoverageReport public static VoiceActivityDetectionSignal fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VoiceActivityDetectionSignal.class); + return Common.fromJsonString(jsonString, VoiceActivityDetectionSignal.class); } } diff --git a/src/main/java/com/google/genai/types/VoiceConfig.java b/src/main/java/com/google/genai/types/VoiceConfig.java index 2120902d2f8..26c6d4ffdb7 100644 --- a/src/main/java/com/google/genai/types/VoiceConfig.java +++ b/src/main/java/com/google/genai/types/VoiceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -126,6 +127,6 @@ public Builder clearPrebuiltVoiceConfig() { /** Deserializes a JSON string to a VoiceConfig object. */ @ExcludeFromGeneratedCoverageReport public static VoiceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VoiceConfig.class); + return Common.fromJsonString(jsonString, VoiceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/VoiceConsentSignature.java b/src/main/java/com/google/genai/types/VoiceConsentSignature.java index 216994504ac..9f170b81f3f 100644 --- a/src/main/java/com/google/genai/types/VoiceConsentSignature.java +++ b/src/main/java/com/google/genai/types/VoiceConsentSignature.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -76,6 +77,6 @@ public Builder clearSignature() { /** Deserializes a JSON string to a VoiceConsentSignature object. */ @ExcludeFromGeneratedCoverageReport public static VoiceConsentSignature fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, VoiceConsentSignature.class); + return Common.fromJsonString(jsonString, VoiceConsentSignature.class); } } diff --git a/src/main/java/com/google/genai/types/WebSearch.java b/src/main/java/com/google/genai/types/WebSearch.java index 22f26aed2b9..b5b08ae86e0 100644 --- a/src/main/java/com/google/genai/types/WebSearch.java +++ b/src/main/java/com/google/genai/types/WebSearch.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; /** Standard web search for grounding and related configurations. Only text results are returned. */ @@ -51,6 +52,6 @@ private static Builder create() { /** Deserializes a JSON string to a WebSearch object. */ @ExcludeFromGeneratedCoverageReport public static WebSearch fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, WebSearch.class); + return Common.fromJsonString(jsonString, WebSearch.class); } } diff --git a/src/main/java/com/google/genai/types/WebhookConfig.java b/src/main/java/com/google/genai/types/WebhookConfig.java index 515076f4448..7759a9a3991 100644 --- a/src/main/java/com/google/genai/types/WebhookConfig.java +++ b/src/main/java/com/google/genai/types/WebhookConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Arrays; import java.util.List; @@ -125,6 +126,6 @@ public Builder clearUserMetadata() { /** Deserializes a JSON string to a WebhookConfig object. */ @ExcludeFromGeneratedCoverageReport public static WebhookConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, WebhookConfig.class); + return Common.fromJsonString(jsonString, WebhookConfig.class); } } diff --git a/src/main/java/com/google/genai/types/WhiteSpaceConfig.java b/src/main/java/com/google/genai/types/WhiteSpaceConfig.java index e048da83af1..7ad29eb1e06 100644 --- a/src/main/java/com/google/genai/types/WhiteSpaceConfig.java +++ b/src/main/java/com/google/genai/types/WhiteSpaceConfig.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -98,6 +99,6 @@ public Builder clearMaxOverlapTokens() { /** Deserializes a JSON string to a WhiteSpaceConfig object. */ @ExcludeFromGeneratedCoverageReport public static WhiteSpaceConfig fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, WhiteSpaceConfig.class); + return Common.fromJsonString(jsonString, WhiteSpaceConfig.class); } } diff --git a/src/main/java/com/google/genai/types/WordInfo.java b/src/main/java/com/google/genai/types/WordInfo.java index b3916c96767..1a09d408d87 100644 --- a/src/main/java/com/google/genai/types/WordInfo.java +++ b/src/main/java/com/google/genai/types/WordInfo.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.auto.value.AutoValue; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.genai.Common; import com.google.genai.JsonSerializable; import java.util.Optional; @@ -120,6 +121,6 @@ public Builder clearEndOffset() { /** Deserializes a JSON string to a WordInfo object. */ @ExcludeFromGeneratedCoverageReport public static WordInfo fromJson(String jsonString) { - return JsonSerializable.fromJsonString(jsonString, WordInfo.class); + return Common.fromJsonString(jsonString, WordInfo.class); } }